Re: Threads and Ruby



On Mon, Jun 30, 2008 at 9:04 AM, Joel VanderWerf
<vjoel@xxxxxxxxxxxxxxxxx> 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???

.



Relevant Pages

  • Re: How to get data from html table
    ... Please help me out how to do this in ruby. ... Only a few lines of Ruby are required to accomplish this: ... BTW there are some errors in your HTML sample. ... always filter a few errors, ...
    (comp.lang.ruby)
  • Re: Is Ruby For Me?
    ... what I can accomplish in my comfort zone of Delphi and VCL's both 3rd ... Party and home grown, and how fast I can accomplish it, but how long ... will my learning curve be to accomplish the same in Ruby" dilemma. ... quickbooks data to provide automated transactions based on business ...
    (comp.lang.ruby)
  • Re: The ducks backside
    ... :) I would never use a Ruby feature just because Ruby ... programming) is as a means to accomplish some purpose. ...
    (comp.lang.ruby)
  • Re: Threads and Ruby
    ... in Ruby, which version of Ruby should I be using. ... What I'd like to accomplish is starting a main ruby instance, ... launch threads from that instance that run in their own sandbox. ...
    (comp.lang.ruby)
  • Threads and Ruby
    ... it seems confusing and conflicting. ... in Ruby, which version of Ruby should I be using. ... What I'd like to accomplish is starting a main ruby instance, ...
    (comp.lang.ruby)