curl-library
Re: mutex stuff
Date: Thu, 21 Mar 2002 10:42:10 +0100 (MET)
On Thu, 21 Mar 2002, Noel Byron wrote:
> I hope there is already somebody listening on the new mailing list. :o)
Yeah, there is. Not very many yet, but hey its not our fault! ;-). Still,
this sounds like libcurl development talk so I've cc'ed this reply over to
that list and further development talk about this should probably be taken
there.
> Is anybody working on the mutex code? I ask, because I started doing this
> yesterday night.
I don't think anyone is currently working on that part, no. At least no one
told me! ;-)
> At the moment I'm thinking about a struct, containing pointers to user
> defined mutex functions (create, delete, lock, unlock) and a curl_mutex_t
> (the mutex type; only refferd to using a pointer so the implementation will
> be left to the user code).
Did you check out the previous posts on this subject? Check out the 'sharing
is caring' thread in the January libcurl archive:
http://curl.haxx.se/mail/lib-2002-01/. It started off with this mail:
http://curl.haxx.se/mail/lib-2002-01/0107.html
The key issue is of course that libcurl itself cannot and shall not get
involved in mutex calls, just as you suggest we should add mutex callbacks
that the application must provide in order for this to work.
Back then, I and Bjorn Reese were arguing for not having the create and
delete operations done from within libcurl but instead only have two
functions, lock and unlock (http://curl.haxx.se/mail/lib-2002-01/0121.html).
Sterling hughes and Dirk Manske argued for the create/delete functions and
now you're added to that list too.
I'd be happy to get more input and reasons why we would use either way.
> BTW I wrote mutex code for posix threads and windows threads. I think we
> could integrate it in libcURL. Or we could pack this code to the libcURL
> distribution for libcURL users as an example.
The actual mutex implementation can be included in the curl archives as
examples, or distributed separately. The main point being that it won't
become a part of the actual library.
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/Received on 2002-03-21