Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Win32 ActiveState Perl 5.8 - use threads

by ambrus (Abbot)
on Jan 03, 2005 at 09:36 UTC ( #418905=note: print w/replies, xml ) Need Help??


in reply to Win32 ActiveState Perl 5.8 - use threads

Probably no, at least it's not documented in perldoc threads.

Install ruby, create a ruby thread, and than you can use the alive? method of a Thread to see if it's finished yet.

Update: A straightforward translation of your code to ruby is:

#!ruby -w thread = Thread.new { sleep 10; puts "Ok"; }; i = 0; while true; i += 1; puts "#{i} - #{thread}"; if !thread.alive?; break; end; sleep 1; end; __END__

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://418905]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2023-12-05 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (27 votes). Check out past polls.

    Notices?