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


Groups > comp.lang.ruby > #4124

Re: Threading Loops

Path csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.ruby
Subject Re: Threading Loops
Date Sun, 08 May 2011 12:56:17 +0200
Lines 28
Message-ID <92nb6sFlrdU1@mid.individual.net> (permalink)
References <670f5be69524ccbfc188e9062e65f645@ruby-forum.com> <87ee768ca8304d2274498a72e123120d@ruby-forum.com> <20c6744b0ee8dab8aadd6cc6e2add6e6@ruby-forum.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net RwhxRaNox5bccXGJOeHSvgQoEetDhfqnypk0099gpTUzB9xJ0=
Cancel-Lock sha1:Zi2UK9H/3cwjHndBByZzak3G1b0=
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10
In-Reply-To <20c6744b0ee8dab8aadd6cc6e2add6e6@ruby-forum.com>
X-Antivirus avast! (VPS 110507-1, 07.05.2011), Outbound message
X-Antivirus-Status Clean
Xref x330-a1.tempe.blueboxinc.net comp.lang.ruby:4124

Show key headers only | 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