Stopping a watcher in one callback where another may be called

2011-03-29 Thread Arlen Cuss
Hi all, I'm using an ev_timer to timeout an operation where an ev_io may be either listening for reads or writes. The ev_io watcher is allocated in a struct which - if the ev_timer is triggered - gets deallocated. The ev_io is of course stopped before its memory disappears. My question now: say b

Re: Using libev with pthreads and one listening socket

2011-03-29 Thread Arlen Cuss
duce. This seems to be the case. Right now I'm still employing the (possibly criminal) method of having all threads listen on the fd - it saves on the syscalls -- maybe I don't need to worry about that anyway -- but it's also a simpler design. Thanks very much for your input! Che

Re: Using libev with pthreads and one listening socket

2011-03-29 Thread Arlen Cuss
would only happen > with child processes. (Not 100% on this though) > > I probably raised more questions than I answered, > hope I helped anyway. > > regards, > Maarten > > > > On Mon, 2011-03-14 at 18:14 +1100, Arlen Cuss wrote: > > I've partly resolved

Re: Using libev with pthreads and one listening socket

2011-03-14 Thread Arlen Cuss
ever thread gets to the trigger first as to who gets the fd (which I don't mind), but it's nicer to be able to avoid the excess computation of the other 3 (on a 4-core) threads all trying to accept(). Any suggestions would be warmly appreciated. Cheers, Arlen On Mon, 2011-03-14 at 11:47 +

Using libev with pthreads and one listening socket

2011-03-13 Thread Arlen Cuss
Hi all, I apologise if this question's been asked before -- I've had a Google around, and haven't found a satisfactory answer (yet). I'm writing a HTTP proxy using libev (code here: [1]), and I'm now trying to adapt it to run with an arbitrary number of threads, ideally so that it would be able t