hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ROLWE...@de.ibm.com>
Subject RE: Is this a good idea?
Date Fri, 09 Feb 2007 13:27:39 GMT
Hi Steve,

> Well, that's the thing. The HttpState will be wrapped up in the
> singleton. Some of the servers we support will allow up to 32
> simultaneous threads of execution. How will that work when all posts are
> done via a singleton?

The state is required twice for each execution: just before
the request is sent and just after the response header is
received. During the sending and during the response processing,
the state is not accessed and the threads will not synchronize
If you use different HttpClient objects, you will have separate
HttpState objects, too. If that is what you want, you can keep
the HttpClient singleton and have each thread keep it's own state.
That is less overhead than having a connection manager per thread.

hope that helps,

View raw message