Re: Threads issue.
- From: Erik Veenstra <erikveen@xxxxxxxxx>
- Date: Sat, 30 Jun 2007 17:41:19 +0900
Joining a stopped thread causes a deadlock.
Consider this deadlocking code:
Thread.fork do
Thread.stop
end.join
On the other hand, the following code does work:
Thread.fork do
Thread.stop
end.run.join
To prove that Thread.stop was really executed, I ran both
scripts with a trace:
http://www.erikveen.dds.nl/tmp/code1.trace.png
http://www.erikveen.dds.nl/tmp/code2.trace.png
gegroet,
Erik V. - http://www.erikveen.dds.nl/
.
- References:
- Threads issue.
- From: Marcin Tyman
- Threads issue.
- Prev by Date: Re: Regular Expression question
- Next by Date: Re: Syntax sugar: method[](...) => method(...)
- Previous by thread: Re: Threads issue.
- Next by thread: Newbie: fastcsv: Read rows, print rows
- Index(es):