Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #4097

Re: Threading Loops

From 7stud -- <bbxx789_05ss@yahoo.com>
Newsgroups comp.lang.ruby
Subject Re: Threading Loops
Date 2011-05-07 20:56 -0500
Organization Service de news de lacave.net
Message-ID <ae6643c3e112b8f69927a34afaf2e1ff@ruby-forum.com> (permalink)
References <670f5be69524ccbfc188e9062e65f645@ruby-forum.com>

Show all headers | View raw


Hi,

I don't think threading will speed up your execution time in this case. 
Threading is an illusion: processing switches rapidly between threads; 
threads don't actually execute at the same time.  So unless there is 
some waiting going on somewhere in your code,  and switching to another 
thread will make use of that downtime, there won't be any improvement in 
execution speed.

Even if you have a computer with multiple processors, it won't help:

===
..if your machine has more than one processor, Ruby threads won't take 
advantage of that fact - because they run in one process, and in a 
single native thread, they are constrained to run on one processor at a 
time.

http://rubylearning.com/satishtalim/ruby_threads.html
===

-- 
Posted via http://www.ruby-forum.com/.

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Threading Loops "Bobby S." <kajisakka@gmail.com> - 2011-05-07 18:20 -0500
  Re: Threading Loops Roy Zuo <roylzuo@gmail.com> - 2011-05-07 18:42 -0500
  Re: Threading Loops "Bobby S." <kajisakka@gmail.com> - 2011-05-07 19:03 -0500
    Re: Threading Loops 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-07 21:54 -0500
      Re: Threading Loops Robert Klemme <shortcutter@googlemail.com> - 2011-05-08 12:53 +0200
  Re: Threading Loops "Bobby S." <kajisakka@gmail.com> - 2011-05-07 20:04 -0500
  Re: Threading Loops "Bobby S." <kajisakka@gmail.com> - 2011-05-07 20:48 -0500
    Re: Threading Loops 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-07 21:16 -0500
      Re: Threading Loops Robert Klemme <shortcutter@googlemail.com> - 2011-05-08 12:56 +0200
  Re: Threading Loops 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-07 20:56 -0500
    Re: Threading Loops Christopher Dicely <cmdicely@gmail.com> - 2011-05-07 22:36 -0500
  Re: Threading Loops Kevin Bullock <kbullock+rubyforum@ringworld.org> - 2011-05-07 21:27 -0500
  Re: Threading Loops "Bobby S." <kajisakka@gmail.com> - 2011-05-07 22:12 -0500
  Re: Threading Loops Brian Candler <b.candler@pobox.com> - 2011-05-08 09:07 -0500

csiph-web