Re: mutual exclusion and barriers with libwww 3.0
> I'm trying to do the following:
> Create n threads which load n different pages
> When each page is loaded, stores the data in one big structure
> When all n pages have been loaded into the structure, start doing some analysis.
> Obviously, I need a mutex around the structure, and some kind of
> barrier before I do that analysis. Does libwww support this, or am I
> going to be stuck doing this serially or playing with POSIX threads?
The thread model in the Library does only have three methods:
- create a new thread
- delete an existing thread when terminated normally
- kill a thread right away
It does not have any concept of shared memory as every 'thread' is
contained in it's own data object flying around in memory. Once
the (very simple) schedular has picked a pending thread as the
active thread, a pointer to that object will be passed as a parameter
in all the function calls.
This model is not intended to replace posix threads but to be able to work
together with them but at the same time to provide a simple API that
allows interruptiple, `asynchronous' I/O.
Henrik Frystyk frystyk@W3.org
World-Wide Web Consortium, Tel + 1 617 258 8143
MIT/LCS, NE43-356 Fax + 1 617 258 8682
77 Massachusetts Avenue
Cambridge MA 02154, USA