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


Groups > comp.lang.ruby > #4124

Re: Threading Loops

From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.ruby
Subject Re: Threading Loops
Date 2011-05-08 12:56 +0200
Message-ID <92nb6sFlrdU1@mid.individual.net> (permalink)
References <670f5be69524ccbfc188e9062e65f645@ruby-forum.com> <87ee768ca8304d2274498a72e123120d@ruby-forum.com> <20c6744b0ee8dab8aadd6cc6e2add6e6@ruby-forum.com>

Show all headers | View raw


On 08.05.2011 04:16, 7stud -- wrote:
> Bobby S. wrote in post #997304:
>> The threading made no deference in speed at all not what I expected.
>>
>
> Ok, that is what I expected.  To truly do two things at once in ruby,
> you have to create multiple processes.  So you need to read up on
> fork().

It's questionable whether that will yield any benefit since it's likely 
not CPU what's making it slow but rather IO.  Depending on the file 
system there might be some locking on the directory involved when 
renaming.  In any case a FS needs to take measures to not make disk 
contents inconsistent in case there are multiple concurrent writes to a 
directory.  That's where the bottleneck likely lies.

I don't think that doing the rename concurrently will give any 
improvements.  I would just do it sequentially or at least not with so 
many threads (at most 2).  I don't think it's worth going through that 
hassle.

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.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