Re: How to check if a thread is alive?

[email protected] ("EastInspection USA")
Newsgroups perl.ithreads
Message-ID <[email protected]>
Hi there,

After I installed load & Exit packages, I started to install
Thread::Running. But "nmake test" failed, do you guys have any clue? Thank
you very much.

J.

The perl I am using:

F:\LWP>perl -V
Summary of my perl5 (revision 5 version 8 subversion 0) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef use5005threads=undef useithreads=define
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef


Error output:

C:\TEMP\Thread-Running-0.04>"c:\program files\Microsoft Visual
studio\VC98\Bin\nmake.exe" test

Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

        F:\ActivePerl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib\lib', 'blib\arch')" t\Running01.t t\
Running02.t t\Running03.t
t\Running01....ok 3/19Free to wrong pool 15d32f8 not 1b0abd0 at (eval 18)
line 16.
t\Running01....dubious
        Test returned status 5 (wstat 1280, 0x500)
DIED. FAILED tests 4-19
        Failed 16/19 tests, 15.79% okay
t\Running02....ok 2/18Free to wrong pool 15d32f8 not 1b0ab58 at (eval 18)
line 16.
t\Running02....dubious
        Test returned status 5 (wstat 1280, 0x500)
DIED. FAILED tests 3-18
        Failed 16/18 tests, 11.11% okay
t\Running03....ok 1/17Free to wrong pool 15d32f8 not 1aeb1d8 at (eval 17)
line 16.
t\Running03....dubious
        Test returned status 4 (wstat 1024, 0x400)
DIED. FAILED tests 2-17
        Failed 16/17 tests, 5.88% okay
Failed Test   Stat Wstat Total Fail  Failed  List of Failed
----------------------------------------------------------------------------
---
t\Running01.t    5  1280    19   16  84.21%  4-19
t\Running02.t    5  1280    18   16  88.89%  3-18
t\Running03.t    4  1024    17   16  94.12%  2-17
Failed 3/3 test scripts, 0.00% okay. 48/54 subtests failed, 11.11% okay.
NMAKE : fatal error U1077: 'F:\ActivePerl\bin\perl.exe' : return code '0x2'
Stop.
"Mike Pomraning" <[email protected]> wrote in message
news:[email protected]...
> On Tue, 18 Nov 2003, EastInspection USA wrote:
>
> > It seems to me it is a bug in ithread. If a thread dies, then
> > ithread->list() should not list it as an alive thread.
>
> This is a documentation ambiguity, not a bug in ithreads.  :-)  Some of
the
> threads documentation is drawn from previous implementations, and is a
little
> dusty here and there.  The L<threads> documentation states more precisely
that
>
>   threads->list();
>       This will return a list of all non joined, non detached threads.
>   [http://www.perldoc.com/perl5.8.0/lib/threads.html]
>
> A non-detached thread that has finished its entry point routine, perhaps
by
> die()ing, is still joinable.  This is somewhat analogous to wait()ing for
a
> terminated process (at least on POSIXy systems).
>
> So, threads->list lists joinable threads; take a look at Liz's
Thread::Running
> to find out whether your threads are still in their entry point routines.
>
> Regards,
> Mike
> --
> Michael J. Pomraning
> [email protected]
> http://pilcrow.madison.wi.us
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.