develooper Front page | perl.perl5.porters | Postings from April 2003

Re: 5.8.1@19053: threads goofs

Thread Previous | Thread Next
From:
Ilya Zakharevich
Date:
April 4, 2003 01:12
Subject:
Re: 5.8.1@19053: threads goofs
Message ID:
20030404091234.GA6523@math.berkeley.edu
On Fri, Apr 04, 2003 at 07:31:01AM +0300, Jarkko Hietaniemi wrote:
> > > The Perl_ithread_hook() function generates the warning
> > > if active_threads != 1 and aTHX == PL_curinterp (ie a thread is
> > > destroying it's 'own' interpreter and not an interpreter created
> > > for another thread).
> > 
> > How can the latter happen?  Moreover, this does not happen when a
> 
> That can happen very easily.

Do not see how what you wrote is relevant.

> -e 'threads->new(sub{1 while 1})'
> 
> The main thread falls off the end, and starts destroying its own
> interpreter.  The _other_ interpreter is the one patiently executing
> '1' hoping that '1' will become false.  It's the main thread / main
> interpreter giving the warning when it's on its way out.  The
> sub/child thread/interpreter is shutdown more unceremoniously and gets
> to say nothing.

What exactly is done when things are done "unceremoniously" and how it
is related to a thread destroying an interpreter created for another
thread?  I'm puzzled; there *is* an OS/2 API to shut down a different
thread; but I did not code any call to it to os2-specific part of Perl.

> > Please show how this message may be triggered without the process
> > immediately ending.
> 
> You are right on that the whole process dies but you are confusing
> effects with side-effects.  The message we are arguing over is caused
> by a side-effect.  The final effect is, of course, that the whole Perl
> process dies, but the message is still caused by one particular
> side-effect, not by the whole death.

???  What is the sense for discussing *by what mechanism* this message
is generated?

This message has *a purpose*.  It is emited to convey an important
piece of information to the user.  Many thanks for whoever implemented
this message.

IMO, the *only* problem with the message is that the wording does not
correlate well with the purpose of the message.

Hope this helps,
Ilya

Thread Previous | Thread Next


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