Re: Feature request: ability to use libeio with multiple event loops

2011-12-20 Thread Marc Lehmann
On Wed, Dec 21, 2011 at 03:37:48AM +0100, Ben Noordhuis wrote: > You either have an overly broad definition of or simply the wrong idea > about what CPU registers are. Then you can surely point out where my idea differs from, say, intel's or motorola's idea of what registers are. Please do so, I

Re: Feature request: ability to use libeio with multiple event loops

2011-12-20 Thread Ben Noordhuis
On Wed, Dec 21, 2011 at 01:46, Marc Lehmann wrote: > On Tue, Dec 20, 2011 at 09:26:28PM +0100, Hongli Lai > wrote: >> I would like to know more about this claim. It's not that I don't >> believe you, but I'm genuinely interested in this area and I hear all >> kinds of (often contradicting) infor

Re: Feature request: ability to use libeio with multiple event loops

2011-12-20 Thread Marc Lehmann
On Tue, Dec 20, 2011 at 09:26:28PM +0100, Hongli Lai wrote: > I would like to know more about this claim. It's not that I don't > believe you, but I'm genuinely interested in this area and I hear all > kinds of (often contradicting) information about threads vs processes. > What is it about proces

Re: Feature request: ability to use libeio with multiple event loops

2011-12-20 Thread Marc Lehmann
On Tue, Dec 20, 2011 at 09:26:20PM +0100, Hongli Lai wrote: > I know, but that's not what I mean. I'm talking about reentrancy. > Right now the libeio API assumes that there is one event loop. The libeio actually makes no assumptions about the existance of an event loop, or there being only one.

Re: Feature request: ability to use libeio with multiple event loops

2011-12-20 Thread Hongli Lai
On Tue, Dec 20, 2011 at 5:06 PM, Marc Lehmann wrote: > Threads were meant as an optimisation for single cpu systems though, and > processes are meant for multiple cpus (or cores), and use the available > hardware more efficiently. I would like to know more about this claim. It's not that I don't

Re: Feature request: ability to use libeio with multiple event loops

2011-12-20 Thread Hongli Lai
On Tue, Dec 20, 2011 at 4:17 PM, Marc Lehmann wrote: > global variables are entirely fine with threads (libeio itself uses > threads). I know, but that's not what I mean. I'm talking about reentrancy. Right now the libeio API assumes that there is one event loop. The want_poll callback assumes th

Re: Feature request: ability to use libeio with multiple event loops

2011-12-20 Thread Marc Lehmann
On Tue, Dec 20, 2011 at 03:26:22PM +0100, Hongli Lai wrote: > event loop per thread. I'm thinking about multiple eio contexts with > each context having its own thread pool. This is strictly less useful though, as you lose control over scheduling, which might not be an issue for you though. > Th

Re: Feature request: ability to use libeio with multiple event loops

2011-12-20 Thread Marc Lehmann
On Tue, Dec 20, 2011 at 02:34:52PM +0100, Hongli Lai wrote: > I'm writing a multithreaded evented server in which I have N threads > (N=number of CPU cores) and one libev event loop per thread. I want to > use libeio but it looks like libeio depends on global variables so > this isn't going to wor

Re: Feature request: ability to use libeio with multiple event loops

2011-12-20 Thread Hongli Lai
On Tue, Dec 20, 2011 at 3:04 PM, Paddy Byers wrote: > This has been asked for before and rejected. > > This is what I'm doing, which works well: > > http://lists.schmorp.de/pipermail/libev/2011q4/001584.html (Replying to libev mailing list so that Marc can see my reasons) I see. My case is a lit

Feature request: ability to use libeio with multiple event loops

2011-12-20 Thread Hongli Lai
I'm writing a multithreaded evented server in which I have N threads (N=number of CPU cores) and one libev event loop per thread. I want to use libeio but it looks like libeio depends on global variables so this isn't going to work. I'd like to request the ability to use libeio with multiple event