From 9301bc17a408f3f70fada10f6bfa76e2e02f7229 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 4 Jun 2002 12:12:08 +0000 Subject: [PATCH] 2002-06-04 Marcus Brinkmann * gpgme.texi (Multi Threading): Document new autodetection. --- trunk/doc/ChangeLog | 4 ++++ trunk/doc/gpgme.texi | 41 ++++++++++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/trunk/doc/ChangeLog b/trunk/doc/ChangeLog index 8e3fc21..58b3799 100644 --- a/trunk/doc/ChangeLog +++ b/trunk/doc/ChangeLog @@ -1,3 +1,7 @@ +2002-06-04 Marcus Brinkmann + + * gpgme.texi (Multi Threading): Document new autodetection. + 2002-06-04 Marcus Brinkmann * Makefile.am (DISTCLEANFILES): New variable. diff --git a/trunk/doc/gpgme.texi b/trunk/doc/gpgme.texi index 67e496e..6f64e45 100644 --- a/trunk/doc/gpgme.texi +++ b/trunk/doc/gpgme.texi @@ -450,17 +450,40 @@ If the following requirements are met, there should be no race conditions to worry about: @itemize @bullet +@item +@acronym{GPGME} supports the thread libraries pthread and GNU Pth. +The support for this has to be enabled at compile time. +@acronym{GPGME} will automatically detect the location in which the +thread libraries are installed and activate the support for them. + +Support for other thread libraries is very easy to add. Please +contact us if you have the need. + +@item +If you link your program dynamically to @acronym{GPGME} and your +supported thread library, @acronym{GPGME} will automatically detect +the presence of this library and activate its use. If you link to +both pthread and GNU Pth, @acronym{GPGME} will use the pthread +support. This feature requires weak symbol support. + +@item +If you link your program statically to @acronym{GPGME}, there is +currently no easy way to make sure that @acronym{GPGME} detects the +presence of the thread library. This will be solved in a future +version. + @item The function @code{gpgme_check_version} must be called before any -other function in the library, because it initializes the locking -subsystem in @acronym{GPGME}. To achieve this in all generality, it -is necessary to synchronize the call to this function with all other -calls to functions in the library, using the synchronization -mechanisms available in your thread library. Otherwise, specific -compiler or CPU memory cache optimizations could lead to the situation -where a thread is started and uses @acronym{GPGME} before the effects -of the initialization are visible for this thread. It doesn't even -suffice to call @code{gpgme_check_version} before creating this other +other function in the library, because it initializes the thread +support subsystem in @acronym{GPGME}. To achieve this in all +generality, it is necessary to synchronize the call to this function +with all other calls to functions in the library, using the +synchronization mechanisms available in your thread library. +Otherwise, specific compiler or CPU memory cache optimizations could +lead to the situation where a thread is started and uses +@acronym{GPGME} before the effects of the initialization are visible +for this thread. It doesn't even suffice to call +@code{gpgme_check_version} before creating this other thread@footnote{In SMP systems the new thread could be started on another CPU before the effects of the initialization are seen by that CPU's memory cache. Not doing proper synchronization here leads to -- 2.26.2