develooper Front page | perl.perl5.porters | Postings from November 1999

Re: [PATCH 5.005_62] Allow XS code to lock arbitrary scalars

Dan Sugalski
November 16, 1999 08:29
Re: [PATCH 5.005_62] Allow XS code to lock arbitrary scalars
Message ID:
A while ago, Joshua N Pritikin <> wrote:
>On Tue, Nov 16, 1999 at 09:33:54AM -0500, wrote:
>> The following patch provides a new macro, SvLOCK, which lets XS code snag a
>> perl-level lock on an arbitrary SV *.
>If you publish a macro like this for SvLOCK then you prohibit mixing in
>FAKE_THREADS or continuations.  Granted, the Perl_call_* API already
>complicates things but do we want to expand on this same messy design? 
>State should not be kept on the C stack lightly.  I think a better
>solution is to allow a varient of XSUBs that work more like opcodes.

Huh? No it doesn't, unless I'm really confused here. With this, to lock a
scalar from within XS code means doing:


and nothing more. How does that prohibit mixing in fake threads? (Which
don't work yet anyway) The current definition of it may be problematic for
fake threads, but that's why it's hidden inside a macro anyway. If/when
fake threads work, then we can patch it up, along with what's probably a
lot of other stuff.


----------------------------------------"it's like this"-------------------
Dan Sugalski                            even samurai                           have teddy bears and even
                                        teddy bears get drunk Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About