Stas Bekman wrote:

>Steve Hay wrote:
>  
>
>>Stas Bekman wrote:
>>
>>
>>    
>>
>>>But I don't get the segfault.
>>>
>>>I'd like to explore the possibility that we have a need for CLONE in Perl 
>>>sections and PerlLoadModule next. I wish I had the segfault, though. I need to 
>>>think how to create it. But if I fail I'll try to analyze whether we CLONE is 
>>>needed. If you don't know what CLONE is please see:
>>>http://apache.org/~stas/Example-CLONE-0.02.tar.gz
>>>
>>>      
>>>
>>I had a look at Example-CLONE.  When I run "nmake test" it passes all 
>>tests successfully, but then I get an application error popup, and it 
>>spits out "A thread exited while 2 threads were running" on the 
>>console.  It's OK if I run the two tests, basic.t and threads.t, 
>>individually.
>>    
>>
>
>Yes, that's a known problem in perl threads. Try replacing detach call with join:
>
Yeah, that fixes it.

- Steve

>
>
>Index: t/threads.t
>===================================================================
>RCS file: /home/stas/cvs/modules/Example-CLONE/t/threads.t,v
>retrieving revision 1.1
>diff -u -r1.1 threads.t
>--- t/threads.t 31 Dec 2003 05:40:32 -0000      1.1
>+++ t/threads.t 12 Jan 2004 17:17:25 -0000
>@@ -31,7 +31,7 @@
>
>  # as the new threads are spawned they will inherit the count from the
>  # main thread
>-threads->new(\&read_test)->detach for 1..$threads;
>+threads->new(\&read_test) for 1..$threads;
>
>  sub read_test : locked {
>      for my $count (1..2) {
>@@ -42,8 +42,5 @@
>      }
>  }
>
>-# workaround the situations where the main thread exits before the
>-# child threads, which shouldn't be a problem since all threads are
>-# detached, but something is broken in perl
>-select(undef, undef, undef, 0.25); # sleep 0.25sec
>+$_->join() for threads->list();
>
>
>
>__________________________________________________________________
>Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
>http://stason.org/     mod_perl Guide ---> http://perl.apache.org
>mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
>http://modperlbook.org http://apache.org   http://ticketmaster.com
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>------------------------------------------------
>This email has been scanned for viruses and content by the Radan Computational 
>Webshield Appliances.
>
>
>
>  
>




------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are 
confidential and intended for the addressee(s) only.  If you have received this 
message in error or there are any problems, please notify the sender immediately.  The 
unauthorized use, disclosure, copying or alteration of this message is strictly 
forbidden.  Note that any views or opinions presented in this email are solely those 
of the author and do not necessarily represent those of Radan Computational Ltd.  The 
recipient(s) of this message should check it and any attached files for viruses: Radan 
Computational will accept no liability for any damage caused by any virus transmitted 
by this email.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to