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

Re: pipes + threads broken in blead on VMS

Thread Previous
From:
Craig A. Berry
Date:
November 28, 2005 21:25
Subject:
Re: pipes + threads broken in blead on VMS
Message ID:
p06230907bfb190429764@[172.16.52.1]
At 12:50 AM +0100 11/28/05, Rafael Garcia-Suarez wrote:
>On 11/26/05, Craig A. Berry <craigberry@mac.com> wrote:
>> But there are other structures that are pipe-specific, and it seems
>> like a good idea to keep the new sanity check that ensures we close a
>> pipe and deallocate its structures from within the same interpreter
>> context where it was opened. But I haven't thought of a good way to
>> do that for the case where the pipe is opened when there is no
>> context at all yet.  Any suggestions?
>
>Looks to me that we should bypass this check when there is no context.

I agree.  What is the best way to do that?  PL_curinterp == NULL?
PL_thr_key == NULL?   It looks to me that dTHX translates to
pthread_getspecific(), which returns an undefined value before the
key is initialized, so we can't depend on dTHX to tell us whether we
actually have a thread context or not.

The case I am most worried about, though, is the one where we
allocate before thread context is initialized and deallocate after
(possibly during global destruction).   Is global destruction
supposed to be smart enough to recognize things that were created
before there was a thread context and deallocate them differently?
-- 
________________________________________
Craig A. Berry
mailto:craigberry@mac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About