in reply to Event-based app and fork()
Yes, “it makes sense to use both fork and poll,” but I'm not sure that I would do it quite in the way you seem to be contemplating.
Let the main thread (so to speak) do the polling, and let it do all of it. Then, when a piece of work has arrived in that way, it can queue it up and let it be processed by one of the "forks" .. the threads .. which sit around waiting for something to arrive in one of the queues they are listening to. The threads don't “poll.”
Notice also that I'm suggesting that the threads don't die off. They stick around, even if at the moment they have nothing to do.
The main-thread is the switchboard operator. Who is, of course, also the boss.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Event-based app and fork()
by BrowserUk (Patriarch) on Dec 04, 2007 at 13:59 UTC | |
by locked_user sundialsvc4 (Abbot) on Dec 04, 2007 at 23:13 UTC | |
by BrowserUk (Patriarch) on Dec 04, 2007 at 23:29 UTC | |
|