]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
cleanup THREADs notes since the library is now threadsafe
authorTobias Oetiker <tobi@oetiker.ch>
Tue, 16 May 2017 08:31:06 +0000 (10:31 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Tue, 16 May 2017 08:31:06 +0000 (10:31 +0200)
THREADS

diff --git a/THREADS b/THREADS
index b0481638e9ab1dfca9418b9ed2246ac776ebeb3b..85c8d58608f5c98738eaaee995d192c974cbd0f6 100644 (file)
--- a/THREADS
+++ b/THREADS
@@ -1,17 +1,9 @@
-In order to use the librrd in multi-threaded programs you must:
-
-  * Link with librrd_th instead of with librrd
-  * Use the *_r function instead or the *-functions
-  * Never use non *_r functions unless it is explicitly documented that the 
-    function is tread-safe
-
 Every thread SHOULD call rrd_get_context() before the first call to
 any librrd function in order to set up thread specific data. This is
 not strictly required, but it is the only way to test if memory
 allocation can be done by this function. Otherwise the program may die
 with a SIGSEGV in a low-memory situation.
 
-
 IMPORTANT NOTE FOR RRD CONTRIBUTORS:
 
 Some precautions must be followed when developing rrd from now on:
@@ -38,22 +30,12 @@ thread-safe.
 * Do not introduce global variables!
 
   If you really, really have to use a global variable you may add a 
-  new field to the rrd_context structure and modify rrd_error.c,
-  rrd_thread_safe.c and rrd_non_thread_safe.c
-
-* Do not use "getopt" or "getopt_long" in *_r (directly or indirectly)
-
-  getopt uses global variables and behaves badly in a multithreaded
-  application when called concurrently. Instead provide a *_r function
-  taking all options as function parameters. You may provide argc and
-  **argv arguments for variable length argument lists. See
-  rrd_update_r as an example. 
+  new field to the rrd_context structure and modify rrd_error.c and
+  rrd_thread_safe.c
 
 * Do not use the parsetime function!
 
-  It uses lots of global vars. You may use it in functions not
-  designed to be thread-safe like functions wrapping the _r version of some
-  operation (eg. rrd_create, but not in rrd_create_r)
+  If you do make sure to lock your use.
 
 WIN32 Platform Note (added 04/01/03):