Subj : Re: Can long blocking tasks scale? To : comp.programming.threads From : Hans Malherbe Date : Thu Aug 25 2005 01:16 am >You could go with asynchronous i/o (iocp) and do all the i/o from a >small number of threads. This looks ideal since a thread will only be consumed when there is I/O. Since the tasks block so long, how about doing all I/O with a single thread as in the reactor pattern? There is another challenge however. I failed to mention that I only control the client side of the server connections. I can create a completion port for user connections, but the only available option for mainframe communication is a COM interface. I'm thinking now about the half-sync/half-async pattern. How about taking client requests using a completion port and putting them in a queue. A thread pool will take requests from the queue and call the mainframe synchronously. This way we still fail to call the mainframe with thousands of requests simultaneously, but at least we are not choking under load when we should be servicing clients. >The type of network i/o might matter (e.g. tcp vs. udp) Do people use UDP for tasks that need an answer back? .