Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Newbie question about threads and gets
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Robert Klemme, post: 4500588"] Are you aware of the fact that ruby will exit as soon as the main thread exits? So your difference might well be timing related. 10:58:20 [source]: ruby -e 'Thread.new { sleep 1; puts "end" }' 10:59:22 [source]: ruby -e 'Thread.new { sleep 1; puts "end" }; sleep 2' end 10:59:28 [source]: Notice how the first piece doesn't print? That's because the main thread simply exits killing the sleeping first thread. Again, I don't know what you're up to so it's difficult to provide advice how to do it right. In your simple example thread a is pointless IMHO - you could do that as well in the main thread. Cheers robert [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Newbie question about threads and gets
Top