Re: thread safety
Vic Bancroft <[email protected]>
| Newsgroups | gmane.comp.lib.libwww |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> > >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