Initial attempts to add pthread mutex controls around shared and static
data structures ... another step along the path the a thread-safe
libpcp.
pmGetConfig() is thread-safe.
__pmAccAddHost() and __pmAccAddClient() are thread-safe, including their
nested calls to gethostbyname() (which is not thread-safe).
Also some general source code cleanups, e.g. splitting the hashing
routines out of logmeta.c and into the new hash.c, expunge the
MixedCaseMadness from access.c
Changes committed to git://oss.sgi.com/kenj/pcp.git pcp4
(note this is the pcp4 branch)
configure.in | 6
man/man3/pcpintro.3 | 25 ---
man/man3/pmnewcontext.3 | 12 +
src/cpan/PMDA/PMDA.pm | 6
src/cpan/PMDA/cvalue.c | 2
src/include/builddefs.in | 2
src/include/impl.h | 57 ++++++--
src/include/pmapi.h | 40 ++---
src/libpcp/src/AF.c | 66 ++++-----
src/libpcp/src/GNUmakefile | 4
src/libpcp/src/access.c | 271 ++++++++++++++++++++-------------------
src/libpcp/src/config.c | 38 +++--
src/libpcp/src/connectlocal.c | 7 +
src/libpcp/src/context.c | 9 +
src/libpcp/src/derive.c | 12 -
src/libpcp/src/derive_fetch.c | 6
src/libpcp/src/desc.c | 74 +++++-----
src/libpcp/src/err.c | 6
src/libpcp/src/fetch.c | 50 ++++---
src/libpcp/src/fetchlocal.c | 2
src/libpcp/src/hash.c | 112 ++++++++++++++++
src/libpcp/src/help.c | 9 +
src/libpcp/src/instance.c | 37 +++--
src/libpcp/src/interp.c | 14 --
src/libpcp/src/lock.c | 65 +++++++++
src/libpcp/src/logmeta.c | 152 ++++-----------------
src/libpcp/src/logutil.c | 43 +-----
src/libpcp/src/pmns.c | 33 ++--
src/libpcp/src/profile.c | 8 -
src/libpcp/src/rtime.c | 18 +-
src/libpcp/src/store.c | 49 ++++---
src/libpcp/src/tz.c | 4
src/libpcp/src/units.c | 4
src/libpcp/src/util.c | 26 ++-
src/libpcp_trace/src/GNUmakefile | 2
src/pmconfig/pmconfig.c | 2
src/pmdas/cisco/GNUmakefile | 2
src/pmdas/shping/GNUmakefile | 2
src/pmdas/trace/GNUmakefile | 2
src/pmdas/weblog/GNUmakefile | 2
40 files changed, 729 insertions(+), 552 deletions(-)
commit 2e75f23dc947a3e06507794fd23c58b34bcd71f4
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Mon Apr 4 07:10:31 2011 +1000
libpcp - add pthread-based mutex support
+ Basic infrastructure in impl.h and locks.c.
+ Some small steps to using a global lock to control access to static
data structures ... calls in the library are nested, so this needs to
be a counting semaphore style mutex.
+ Better checking after calls to __pmHandleToPtr() which could return
NULL.
+ Lose the MixedCaseMadness in access.c.
commit 3d9bec8453bbe0a9fc8236ddadbe3a5ab9a6a3d9
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Thu Mar 24 20:32:50 2011 +1100
libpcp - thread-safe and refactoring changes
Next steps towards a thread-safe libpcp - this time adding "const" to
a range of declarations.
Make identification of the library for pthreads consistent with the
other optional libraries in the build.
Introduce a "big lock" to be used as a global mutex in libpcp.
Refactor libpcp to remove some replicated code and move the functionality
into libpcp, see __pmPrintStamp() and __pmPrintTimeval(). Also move the
"hash" methods into their own source file.
commit d140ff86d1a3d0b20e86d2cb8e28ea85607a8fa7
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Mon Mar 21 19:12:43 2011 +1100
libpcp - improve re-entrancy
First of a batch of changes suggested by Greg Banks' analysis.
These ones remove some needless 'static' declarations, and gather up
all the various implementations of (unsafe versions) of printstamp(),
and replace them by calls to the (safe versions) of __pmPrintStamp()
or __pmPrintTimeval() in libpcp.
commit b3001a29b4caace785af8234cdaef38d2cb1110e
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Sat Mar 19 20:12:17 2011 +1100
Retire licence error codes
PM_ERR_LICENSE and PM_ERR_PMCDLICENSE are no longer needed.
commit b5b8ba2172af8c4e252bb3736fd7b4d48e36ddfc
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Thu Mar 17 09:36:40 2011 +1100
retire PM_CLUSTER_EVENT - no longer needed
|