diff --git a/doc/rrdthreads.txt b/doc/rrdthreads.txt
index a186f8cbe240794c5821788589bf0a7e7bcc866d..3db8d76c3ced745d1d9029315e40c647249c3dc8 100644 (file)
--- a/doc/rrdthreads.txt
+++ b/doc/rrdthreads.txt
multi-threaded programs
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
multi-threaded programs
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
- Using librrd in multi-threaded programs requires some extra precau-
- tions, as the RRD library in its original form was not thread-safe at
- all. This document describes requirements and pitfalls on the way to
- use the multi-threaded version of librrd in your own programs. It also
- gives hints for future RRD development to keep the library thread-safe.
+ Using librrd in multi-threaded programs requires some extra
+ precautions, as the RRD library in its original form was not thread-
+ safe at all. This document describes requirements and pitfalls on the
+ way to use the multi-threaded version of librrd in your own programs.
+ It also gives hints for future RRD development to keep the library
+ thread-safe.
Currently only some RRD operations are implemented in a thread-safe
way. They all end in the usual ""_r"" suffix.
Currently only some RRD operations are implemented in a thread-safe
way. They all end in the usual ""_r"" suffix.
· Always call "rrd_error_clear()" before any call to the library.
Otherwise the call might fail due to some earlier error.
· Always call "rrd_error_clear()" before any call to the library.
Otherwise the call might fail due to some earlier error.
- N\bNO\bOT\bTE\bES\bS F\bFO\bOR\bR R\bRR\bRD\bD C\bCO\bON\bNT\bTR\bRI\bIB\bBU\bUT\bTO\bOR\bRS\bS
-
+ N\bNO\bOT\bTE\bES\bS F\bFO\bOR\bR R\bRR\bRD\bD C\bCO\bON\bNT\bTR\bRI\bIB\bBU\bUT\bTO\bOR\bRS\bS
Some precautions must be followed when developing RRD from now on:
· Only use thread-safe functions in library code. Many often used
Some precautions must be followed when developing RRD from now on:
· Only use thread-safe functions in library code. Many often used
- libc functions aren't thread-safe. Take care in the following situ-
- ations or when using the following library functions:
+ libc functions aren't thread-safe. Take care in the following
+ situations or when using the following library functions:
- · Direct calls to "strerror()" must be avoided: use "rrd_str-
- error()" instead, it provides a per-thread error message.
+ · Direct calls to "strerror()" must be avoided: use
+ "rrd_strerror()" instead, it provides a per-thread error
+ message.
· The "getpw*", "getgr*", "gethost*" function families (and some
· The "getpw*", "getgr*", "gethost*" function families (and some
- more "get*" functions) are not thread-safe: use the *"_r" vari-
- ants
+ more "get*" functions) are not thread-safe: use the *"_r"
+ variants
· Time functions: "asctime", "ctime", "gmtime", "localtime": use
*"_r" variants
· Time functions: "asctime", "ctime", "gmtime", "localtime": use
*"_r" variants
· A header file named _\br_\br_\bd_\b__\bi_\bs_\b__\bt_\bh_\br_\be_\ba_\bd_\b__\bs_\ba_\bf_\be_\b._\bh is provided that works
with the GNU C-preprocessor to "poison" some of the most common
non-thread-safe functions using the "#pragma GCC poison" directive.
· A header file named _\br_\br_\bd_\b__\bi_\bs_\b__\bt_\bh_\br_\be_\ba_\bd_\b__\bs_\ba_\bf_\be_\b._\bh is provided that works
with the GNU C-preprocessor to "poison" some of the most common
non-thread-safe functions using the "#pragma GCC poison" directive.
- Just include this header in source files you want to keep
- thread-safe.
+ Just include this header in source files you want to keep thread-
+ safe.
· Do not introduce global variables!
· Do not introduce global variables!
provide argc and **argv arguments for variable length argument
lists. See "rrd_update_r" as an example.
provide argc and **argv arguments for variable length argument
lists. See "rrd_update_r" as an example.
- · Do not use the "parsetime" function!
+ · Do not use the "rrd_parsetime" function!
It uses lots of global variables. You may use it in functions not
designed to be thread-safe, like in functions wrapping the "_r"
It uses lots of global variables. You may use it in functions not
designed to be thread-safe, like in functions wrapping the "_r"
- version of some operation (e.g., "rrd_create", but not in "rrd_cre-
- ate_r")
-
- C\bCU\bUR\bRR\bRE\bEN\bNT\bTL\bLY\bY I\bIM\bMP\bPL\bLE\bEM\bME\bEN\bNT\bTE\bED\bD T\bTH\bHR\bRE\bEA\bAD\bD S\bSA\bAF\bFE\bE F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS
+ version of some operation (e.g., "rrd_create", but not in
+ "rrd_create_r")
- Currently there exist thread-safe variants of "rrd_update", "rrd_cre-
- ate", "rrd_dump", "rrd_info", "rrd_last", and "rrd_fetch".
+ C\bCU\bUR\bRR\bRE\bEN\bNT\bTL\bLY\bY I\bIM\bMP\bPL\bLE\bEM\bME\bEN\bNT\bTE\bED\bD T\bTH\bHR\bRE\bEA\bAD\bD S\bSA\bAF\bFE\bE F\bFU\bUN\bNC\bCT\bTI\bIO\bON\bNS\bS
+ Currently there exist thread-safe variants of "rrd_update",
+ "rrd_create", "rrd_dump", "rrd_info", "rrd_last", and "rrd_fetch".
A\bAU\bUT\bTH\bHO\bOR\bR
Peter Stamfest <peter@stamfest.at>
A\bAU\bUT\bTH\bHO\bOR\bR
Peter Stamfest <peter@stamfest.at>
-1.2.26 2007-11-20 RRDTHREADS(1)
+1.4.2 2008-06-08 RRDTHREADS(1)