develooper Front page | perl.perl5.porters | Postings from March 2006

Re: how should %^H work with lexical pramas

Thread Previous | Thread Next
Nicholas Clark
March 31, 2006 13:11
Re: how should %^H work with lexical pramas
Message ID:
On Fri, Mar 31, 2006 at 06:45:54PM +0100, Nicholas Clark wrote:

> Is PL_compiling.cop_hints shared across threads?

> +    PL_compiling.cop_hints = PL_curcop->cop_hints;
> +    /* FIXME - is this threadsafe?  Or is it manipulating a shared
> +       resource?  */
> +    if (PL_compiling.cop_hints) {
> +       PL_compiling.cop_hints->refcounted_he_refcnt++;

Oops. I didn't phrase my question correctly. Is  PL_compiling.cop_hints
shared across threads because it's a copy of PL_curcop->cop_hints and
PL_curcop is pointing into a data structure that is shared between threads?
(And therefore that ++ is a race condition)

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About