W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2000

Re: threads and pipelining

From: <jose.kahan@w3.org>
Date: Fri, 1 Sep 2000 11:40:38 +0200 (MET DST)
Message-Id: <200009010940.LAA13778@tuvalu.inrialpes.fr>
To: Mihut Ionescu <mihut@EECS.Berkeley.EDU>
CC: www-lib@w3.org

In our previous episode, Mihut Ionescu said:
> I would like to build a multithreaded proxy using libwww.  Each thread
> would handle a different connection, where true pipelined requests can be
> serviced (multiple requests can be received over this connection before
> any response is sent back).

Maybe the question is "is libwww multi-thread safe?".

My answer is that I don't think it's 100 %safe. There are some places
with global static variables, the authentication trees are not semaphore 
protected, and so on.

Other people have been trying to make it multi-thread safe, but I don't
know what's the state of their work.

  Each thread would do more work than just
> fetching an URL, so I don't believe that the "pseudothreads" offered by
> libwww would be enough.  From what I have read, libwww can only handle
> multiple open connections, multiplexed using "select" (I assume), and I'm
> not really sure where the additional code that needs to be executed in
> each thread would go.

Your assumption is correct regarding select.

Any extra code would need to be done thru a handler. You can register
handlers that can be called at different places/states by libwww. 

> Is this doable using libwww?  Thank you for you help.

I think that using multiple threads will not be very easy as you'd need to
patch other parts of the code or write workarounds in your handlers.

Received on Friday, 1 September 2000 05:40:41 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:53 UTC