hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Mueller" <dan.in.a.bot...@gmail.com>
Subject Threadsafety of the classes in core
Date Fri, 06 Jul 2007 18:57:25 GMT
Hi all,

Just a quick question. I'm in the process writing a client based on
http-core (alpha5) and just wanted to check back if I've gotten the things
the right way around concerning the threadsafety of the used classes. I've
started from the example 'Basic HTTP GET'. Am I right assuming that the
following classes (and corresponding implementations) are threadsafe and can
be used concurrently from multiple threads as long as you don't modify them
after initialization: HttpParams, HttpProcessor, HttpHost and
ConnectionReuseStrategy. On the other hand the following cannot be used in a
threadsafe manner: HttpContext (unless you want to use the synced variant)
and HttpClientConnection (HttpRequest and HttpResponse are obviously not).
Any kind of pooling of connections has to be implemented atop of this (which
is what httpclient does, last time I checked).

Are these assumptions correct or am I missing something.

Thanks a lot and keep up the great work. It's appreciated.
Cheers,
Daniel

PS: some short javadoc notice as to what the legal uses are in a
multithreaded environment wouldn't hurt. Maybe if somebody stumbles the next
time across one of those particular classes...

[1]
http://jakarta.apache.org/httpcomponents/httpcomponents-core/examples.html

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message