From: Dan K. <da...@ke...> - 2003-06-11 07:22:58
|
Beau D. Simensen wrote: > The program I've written is currently doing the following: > > o Main thread loops, checking a list of remote request handlers to see > if one of them needs to be queued up for a client [most of them are > scheduled based on time, some of them based on other criteria]. If a > request handler is ready to be executed, it pushes a request onto one of > two client connection queues. > > o Two client connection threads wait for new requests to show up in > their queues. When one is found, a connection is opened if one isn't > already opened, the request is sent to the server, and the response is > read. Connection closes after X number of seconds that the connection > hasn't been used. I have to ask -- why are you using threads here? What you've described would work well, and would scale better, using nonblocking i/o and sys_epoll... - Dan -- Dan Kegel http://www.kegel.com http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045 |