On Fri, May 10, 2002 at 01:45:41AM +0300, Jarkko Hietaniemi wrote: > > > until (say) threads::shared::bootstrap() populates the function pointers. > > > > I see threads.pm says: > > : It is also important to note that you preferably enable threads by > > : doing C<use threads> as early as possible and that it is not possible > > : to enable threading inside an eval ""; In particular, if you are > > : intending to share variables with threads::shared, you must > > : C<use threads> before you C<use threads::shared> and threads will emit > > : a warning if you do it the other way around. > > > > but "preferably" seems way too weak. You *must* use threads and > > threads::shared if required *before* loading any extensions > > (or any module that might load extensions). > > > > I think it would be good if the stub hooks for SvSHARE and SvLOCK > > incremented a counter. Then if threads.xs is loaded and the counter > > is non-zero a warning can be given. > > > > > If you want same kind of abstraction for lighter-weight non-recursive > > > MUTEX stuff now would be a good time to make the case. > > > > SvLOCK doesn't look too expensive. And it's basically doing just > > what the DBI already does (looping on a COND_WAIT). So I'm happy > > to dump my code and use yours :) Thanks. > > > > There ought to be some pointers to this stuff in perlguts and perlxs. > > What's the old adage? Oh, yes, "patches welcome" :-) Note that I'm > quite serious, here: since you are an "old threads user", your notes > about migration to "new threads" for XS writers would be really spot on.
That assumes that I'm going to actually do the threads migration work in the DBI anytime soon. Sadly that's unlikely to happen. I've got a pile of other stuff I really _need_ to address first. (I don't use threads. I only picked up on the issue now because I saw a bunch of thread related discussions on perl5-porters.) However, if no one gets to it before I do the DBI thread reworking then I'll happily do a perl doc patch. Might be for 5.8.1 by then. I've been CC'ing this thread to [EMAIL PROTECTED] and maybe someone there (perhaps a mod_perl v2 user) will have a greater need to scratch this itch. Tim.