hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Speirs <bill.spe...@gmail.com>
Subject Re: HttpParams appear to be static/global
Date Fri, 26 Aug 2011 15:55:44 GMT
I'm not trying to be pedantic, just trying to understand this...

>From the Synapse source code for HttpCoreNIOListener:
250         Thread t = new Thread(new Runnable() {
251             public void run() {
252                 try {
253                     ioReactor.execute(ioEventDispatch);

>From the source code for HttpCoreNIOSender:
195         Thread t = new Thread(new Runnable() {
196             public void run() {
197                 try {
198                     ioReactor.execute(ioEventDispatch);

It appears to me that two threads are created for two different
IOReactor objects: one for listening to incoming requests, and another
for sending requests. While this is 100% acceptable (and close to what
I'm currently doing), is it possible to have both running in one
thread? How would the IOEventDispatch which would be handling
everything know that connected() one time would mean that someone has
connected to the server, and another time it meant a connection was
made to the back-end service. Maybe through an attribute (and
associated getAttribute call) in the IOSession?

Thanks...

Bill-

> On Fri, Aug 26, 2011 at 9:29 AM, Oleg Kalnichevski <olegk@apache.org> wrote:
>> 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.
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message