From: Zhukov Pavel Date: 2008-06-30T18:25:34+09:00 Subject: Re: Threads and Ruby On Mon, Jun 30, 2008 at 9:04 AM, Joel VanderWerf wrote: > barjunk wrote: >> >> I've been hunting around for information regarding threads, and to me, >> it seems confusing and conflicting. >> >> What I'm trying to find out is...if I was going to start using threads >> in Ruby, which version of Ruby should I be using. >> >> I've seen folks say that I should use Ruby 1.9 and others say that it >> is possible to use earlier versions. Nothing that I found seemed >> definitive. >> >> I'm new to all this, so this may be part of the problem. >> >> What I'd like to accomplish is starting a main ruby instance, then >> launch threads from that instance that run in their own sandbox. >> >> At this point, I don't believe the threads need to talk with each >> other, but it seems I could use some form of message passing to >> accomplish this. >> >> Any ideas and direction would be helpful. Thanks. >> >> Mike B. > > I haven't used 1.9 much, but the impression I get is: > > - use 1.9 if you need _native_ threads (e.g. to take advantage of multiple > processors, or blocking system calls) > > - use 1.8 if you want in-process threads, which are lighter and pretty good > for multiplexing io calls (using select()). > > If the threads don't need shared state, why not use fork instead of threads? > You can use DRb for IPC. > > -- > vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 > > really advantage on multiply processors? Ruby 1.9 does't use GIL???