XS, multiple embedded interpreters & one time initialization
by Milosz Tanski other posts by this author
Jul 16 2008 8:14AM messages near this date
Re: watchdog() for threads tests?
|
[PATCH] threads::shared 1.26
Does Perl provide any facility, along the lines of pthread_once, that
can guarantee that a piece of code will only get run once; for code like
the initialization of an external libraries' static vars? The boot
section of the XS module is called each time an (embedded) interpreter
loads the module so that's not really a suitable spot. Alternatively, is
there there a way to statically initialize a perl_mutex, ala assigning
PTHREAD_MUTEX_INITIALIZER to a real pthread_mutex, that will work for
all the platforms that Perl supports threading?
The module I'm working with is XML::Xerces, which is a wrapper around
the apache project's xerces-c library. It has a few thread safety issues
that I'm working to solve.
Thanks,
-- Milosz
|