Tanmay Patwardhan | 1 May 2003 02:06
Picon
Favicon

Re: thread safety


In my case, I have a windows DLL which uses libwww underneath to POST and 
get responses back from a servlet. This windows DLL when used by clients, 
who send quick successive requests, results in a failure.

The first request *hangs* so to speak where as the second one, does succeed. 
I noticed that in this case, I get a Host info... REUSING CHANNEL 022310A0 
status message. I tried to mimic the above behaviour through an independent 
threaded NT VC++ application and got the same behaviour.

My main consideration is to get around my DLL problem.

-Tanmay

-----------------------
Tanmay Patwardhan
Applications Developer,
UBS Warburg,
Chicago, IL.
-----------------------

>From: Richard Atterer <richard <at> list03.atterer.net>
>To: www-lib <at> w3.org
>Subject: Re: thread safety
>Date: Thu, 1 May 2003 01:47:13 +0200
>
>
>On Wed, Apr 30, 2003 at 05:29:12PM -0500, Tanmay Patwardhan wrote:
> > I did read previous discussions on the list about libwww not being 
>thread
(Continue reading)

Vic Bancroft | 1 May 2003 05:59
Picon

Re: thread safety


On Wed, 2003-04-30 at 20:06, Tanmay Patwardhan wrote:

> My main consideration is to get around my DLL problem.

Is your shared library used simultaneously by multiple threads ?

> >From: Richard Atterer <richard <at> list03.atterer.net>
> >Date: Thu, 1 May 2003 01:47:13 +0200

> >Why would you *want* it to be thread-safe? It can do several downloads
> >simultaneously in a single thread, so what benefits does running it in
> >several threads have?

The consensus seems to be that if you want multiple concurrent threads
to use your library, implement a mutex protected queue which allows a
caller to submit a request and block until the request is satisfied by a
single libwww thread or times out.  I do not know of a published source
for such an example.  The version I had done was part of a larger "work
for hire" and not my own to redistribute.  Perhaps we could implement a
"clean room" version using pthread.h and add it as an example.

more,
l8r,
v


Gmane