Re: Has anybody used pthreads with w3-lib

> 	Is w3lib thread safe?

You have to specify the --enable-reentrant and (for
some compilers) the -mt flags. So you get the LibWWW to use the right
system calls.  

But, I could NOT confirm that the LibWWW (test version 5.0a) is
MT-safe. If you look at the code, you will find some unsafe functions.
For instance, I believe that to processing of lists is not MT-safe.
You will get problems, if you use some LibWWW functions parallel from
some application threads. 

There are two solutions:
  
  1) Forbit all parallel calls of LibWWW functions. This can be done
     with mutexes (for instance). So you can not request WWW documents
     parallel from some application threads.

  2) Forbit parallel calls of LibWWW functions and but allow parallel
     calls on some points. I allowed parallel calls around the select
     system call within in event loop. Because the program often waits
     within the select call, other threads have a chance to call
     LibWWW functions. This solution is expensive.

Bye, Björn

Received on Thursday, 20 November 1997 09:14:48 UTC