On Thu, 2011-08-25 at 15:14 -0400, Bill Speirs wrote: > What would be best, for my proxy, would be if I could have a thread > (or pool of threads) waiting on read/write events from *either* the > server socket(s) or the client socket(s). I do not believe that is > possible though... does anyone know how to do that sort of thing? > Using an ExecutorCompletionService was the only way I knew to > accomplish this, but it required two pools of threads. > > Bill- >
Bill, A very common pattern for proxies (used by Apache Synapse, for instance) is to have a small number of i/o dispatch threads (approx. as many as the CPU cores) handling i/o events for incoming and outgoing connections asynchronously and a larger pool of worker threads that are employed to execute long, potentially blocking operations (such as content transformation). I _suspect_ that is what you want. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
