W3C home > Mailing lists > Public > www-lib@w3.org > October to December 2002

RE: using threads in libwww

From: Antropova, Olga A. <olga.antropova@eds.com>
Date: Tue, 8 Oct 2002 12:36:02 -0400 (EDT)
Message-ID: <07E98776DFF1BE448D9C9BA60A79ADA40287D0C1@amwntx1.ugsolutions.com>
To: "'mnautiyal@hss.hns.com'" <mnautiyal@hss.hns.com>, "Antropova, Olga A." <olga.antropova@eds.com>
Cc: Daniel Stenberg <daniel@haxx.se>, www-lib@w3.org

Hi Manoj,

Use the library examples to help making you code work.  When it is working -
try serialization using mutex locking.


-----Original Message-----
From: mnautiyal@hss.hns.com [mailto:mnautiyal@hss.hns.com]
Sent: Tuesday, October 08, 2002 11:20 AM
To: Antropova, Olga A.
Cc: Daniel Stenberg; www-lib@w3.org
Subject: RE: using threads in libwww


Thanks for the information.
Further, can you provide some example code on the lines of the approach you
followed in your product.  To start with serailizing libwww accesses would
of good value.  My problems is still very basic wrt  threading.  I can't
libwww APIs on even one thread.
I get connect () error in HTTCP.c  in following line:
HTTRACE(PROT_TRACE, "HTHost %p going to state TCP_ERROR.\n" _ host);

Why is this so?

Thanks in anticipation,

"Antropova, Olga A." <olga.antropova@eds.com> on 10/08/2002 09:46:18 PM

To:   Manoj Nautiyal/HSS@HSS, Daniel Stenberg <daniel@haxx.se>
cc:   www-lib@w3.org

Subject:  RE: using threads in libwww

In our product we are using libwww in multithreaded environment but we are
locking all libwww accesses so serializing those. The wwwlib is NOT thread
safe. That is the simplest approach to handle libwww in multithreaded

Libww supports concurrent requests processing though. One can take advantage
of that starting the libwww in the separate thread and then communicating
the other threads requests to it. The library thread will be then processing
request in the concurrent facion and when processing of the request is
finised it would notify the threads waiting on the responses that the job is


-----Original Message-----
From: mnautiyal@hss.hns.com [mailto:mnautiyal@hss.hns.com]
Sent: Tuesday, October 08, 2002 10:57 AM
To: Daniel Stenberg
Cc: www-lib@w3.org
Subject: Re: using threads in libwww


Is this possible in libwww, as we are also using libww for RDF parsing. So
can't get away with
this to new one right now.

So far I've about known from libww mailing lists that even in multithreading
requests have
to be serialized among the threads. Hence from a single multithreaded
application the effect
would not be better than as done in a single threaded (virtually no threads)
But my problem is by creating a thread and posting data to server on this
is not working.


Daniel Stenberg <daniel@haxx.se> on 10/08/2002 09:09:50 PM

To:   Manoj Nautiyal/HSS@HSS
cc:   www-lib@w3.org

Subject:  Re: using threads in libwww

On Tue, 8 Oct 2002 mnautiyal@hss.hns.com wrote:

> Please advise how can I get the post successful using thread?

I realize this is not strictly speaking an answer to your question, but for
most people this would be more easier done using libcurl
(http://curl.haxx.se/libcurl/), which also happens to be thread-safe and
requires less code for the same result.

libcurl does not offer a full libwww replacement. It is fairly lightweight

Then again I'm biased, I'm the main author of libcurl.

I'll go back and hide again now.

      Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Received on Tuesday, 8 October 2002 13:10:29 UTC

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