thank you very much it is more clear now. On 2 June 2011 21:28, Brandon Black <[email protected]> wrote:
> On Thu, Jun 2, 2011 at 10:25 PM, Brandon Black <[email protected]> wrote: > > On Thu, Jun 2, 2011 at 10:15 PM, Juan Pablo L > > <[email protected]> wrote: > >> i m trying to avoid using start/stop or even ev_timer_again because the > >> socket is considered busy when taken by a thread and thread will hold > the > >> socket for as long as clients have something to send which could be a > lot of > >> info > >> or just a few bytes, i m trying to say that a thread may hold the socket > >> longer than the > >> idle time out so how can i manage > >> to prevent the event loop from disconnecting a socket that is being used > >> by another thread ? > > > > Well, not knowing the rest of this design, my guess would be that when > > a thread takes control of a socket, it should remove it from the idle > > timer linked list, and when it's done it should re-add it at the end. > > > > I should add: you might try a single-thread design first. Seems like > every time I design for multi-threaded workers to take advantage of > CPU cores, I end up hitting some other limit before I need them and > going back to just running one thread. My last project, I maxed out > the packets/sec rate on the network interface before I had to spin up > a second worker thread. But then again, most of these projects I'm > talking about had very light real processing requirements, they were > mostly just shuffling data around (e.g. proxy servers for custom > protocols). >
_______________________________________________ libev mailing list [email protected] http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
