cURL / Mailing Lists / curl-library / Single Mail


Re: sharing is caring

From: Dirk Manske <>
Date: Mon, 14 Jan 2002 12:16:50 +0100

Sterling Hughes:
>Daniel Stenberg:
> > * Mutexing
> >
> > Instead, I suggest that we have libcurl call two application specified
> > callbacks for retrieving and releasing mutexes, leaving the actual
> > implementation for the outside to decide.
> yep, I've attached a rough implementation of this (very simple)
> functionality/api...

From prior mail:

| Mutex Initialization (Curl_mutex_initialize), Mutex destruction
| (Curl_mutex_destroy), Mutex Locking (Curl_mutex_lock) and Mutex
| unlocking (Curl_mutex_unlock), attached is the patch, and the two
| added files, thread.c and thread.h which should be placed into the
| lib directory. Apply the patch in the base cURL directory.

Hmm, one mutex for everything in libcurl will lock too much. I think
we need one mutex for a each pool, one for cookies, one for the
host cache and so on. Libcurl itselfs should initialize the different

Two additional curl functions are needed:
  Curl_mutexes_initialize and Curl_mutexes_free

The four callbacks are set in struct UserDefined and the mutexes will
be placed in struct SessionHandle. And struct Curl_mutex defined in
thread.h is obsolete.

Dirk Manske | Entwicklung | Nettraffic Internet Performance GmbH | Tel: +49 (0)40-76 79 61-30 | Fax -99
Harburger Schlossstrasse 7 | D-21079 Hamburg-Harburg | Germany
Received on 2002-01-14