W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1999

Re: threading

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Wed, 17 Mar 1999 20:13:07 -0500
Message-Id: <>
To: Andrew Wong <wong@powertv.com>
Cc: www-lib@w3.org
At 13:59 17/03/1999 -0800, Andrew Wong wrote:

>I'm trying to write a simple testing tool, which will simultaneously fetch 
>pages from different URLs, using libwww. 

libwww doesn't support pthreads yet - there have been several discussions
on the www-lib maling list for handling this, so maybe you should ask there.

However, libwww can easily handle multiple simultaneous requests using it's
own thread model. This is essentially what the libwww eventloop is all
about - you can see a couple of examples at


>Therefore I tried to modify showlinks.c. I moved all the original code in 
>main() to a procedure, showlinks(). Inside main(), pthread_create() is
>called to run showlinks() and then it waits for the thread to terminate by
>calling pthread_join(). 

The showlink example already uses the eventloop - it is just currently set
to only do one download. The eventloop.c sample can do as many downloads
you like. You can also see the sample timy browser to see another example:


>However, this simple modification doesn't seem to work and I don't know why.
>I traced the code in GDB and it failed at HTTCP.c:280 connect() Does this
>have anything to do with I/O multiplexing in libwww? It's very helpful if
>you could give me some advice. I am using verison 5.26. Thanks alot for your

Could be that you are using non-blocking sockets without going into the
eventloop. See the sample apps for how to do this.

Henrik Frystyk Nielsen,
World Wide Web Consortium
Received on Wednesday, 17 March 1999 20:13:17 UTC

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