in reply to Re^4: Scope of thread variable
in thread Scope of thread variable
Can you tell me how to use eval on this code?
To achieve what?
How can I restart thread a thread if it died with same thread Id?
You cannot. Thread ids are allocated by the system and are not re-used.
If you need a number within your threads that you assign, just pass it in as a parameter:
for my number (0 ..3)) { my $thr = threads->create ( sub { my $numberPassedIn = shift; worker(); }, $number )->detach(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Scope of thread variable
by mr_p (Scribe) on Apr 08, 2010 at 17:00 UTC | |
by BrowserUk (Patriarch) on Apr 08, 2010 at 17:19 UTC | |
by mr_p (Scribe) on Apr 08, 2010 at 17:31 UTC | |
by BrowserUk (Patriarch) on Apr 08, 2010 at 17:48 UTC | |
by mr_p (Scribe) on Apr 08, 2010 at 17:51 UTC | |
|