From: Charles Oliver Nutter Date: 2007-09-28T19:56:37+09:00 Subject: Re: what is mean by thread scheduler in Ruby? 7stud -- wrote: > Vellingiri Arul wrote: >> what is mean by thread scheduler in Ruby?with example? >> >> >> Please Any one help me? >> >> by >> Vellingiri > > Threads don't execute at the same time despite what the literature might > say. If you have two threads, for instance your main program and one > thread, then one thread executes for a short time, and then execution > switches to the other thread for a short time, and then execution > switches back. The switching back and forth happens so fast that it > gives the appearance that the threads are executing at the same time. > The thread scheduler determines which thread gets execution time and how > much. Some time ago I wrote an article on RubySpec about Ruby's threading implementation; if there's anything to add to that, please do. http://headius.com/rubyspec/index.php/Ruby_Threading There's also an article on JRuby's threading, which is native, concurrent, and just allows the OS to schedule. http://headius.com/rubyspec/index.php/JRuby_Threading - Charlie