Arthur Bergman <[EMAIL PROTECTED]> writes: >On måndag, maj 13, 2002, at 02:56 , Nick Ing-Simmons wrote: > >> >> I meant a run-time switchable abscraction like SvLOCK which >> ALWAYS does CALL_FPTR(PL_lockhook)(aTHX_ sv) >> >> And something populates the variable at runtime. >> >> Likewise we could have Perl_MUTEX_LOCK() always >> CALL_FPTR(PL_mutexlock)(aTHX_ mutex) >> >> and have a dummy function for non-threads case. >> +ve - This makes XS code binary compatible between threads/non-threads. >> -ve - extra overhead > >It isn't binary copmatible anyways, dTHX and friends...
If you build your non-threaded perl with MULIPLICITY it has a dTHX too. (Once upon a time accessing PL_xxxx via aTHX was faster than going for a global - old GCC on a RISC machine - so I have always built that way.) I am fairly sure I have executed am Ithreads built Tk on a MULTIPLICTY perl and vice-versa and had it work - but probably not deliberately. > >MUTEX_INIT MUTEX_LOCK and friends are noops under non threaded perl, so >the functionality is always there. > >Arthur -- Nick Ing-Simmons http://www.ni-s.u-net.com/