Weird behaviour spawning processes

Hi,

Lately I’ve been having a hell of a time (a bad time) trying to fix an
E2BIG error coming from spawn. I finally tracked it down to a bug in
win32.c (Backport #5325: Bug in win32.c CreateChild - Backport192 - Ruby Issue Tracking System). Great. Then I tried
to build ruby from source using VS2008, which I did. Great. Then I
discovered that my unit test that fires off thousands of little
processes takes about 500ms to run each process where it used to take a
few milliseconds. The even weirder thing is that every now and again
when I run it it goes at normal speed, but only occasionally. WTF? I’ve
spent all day on this and I’m starting to tear my hair out. Any ideas
what could account for this?

Cheers,
James

On Wed, Sep 14, 2011 at 5:25 PM, James F.
[email protected] wrote:

Lately I’ve been having a hell of a time (a bad time) trying to fix an E2BIG
error coming from spawn. I finally tracked it down to a bug in win32.c
(Backport #5325: Bug in win32.c CreateChild - Backport192 - Ruby Issue Tracking System). Great. Then I tried to build ruby from
source using VS2008, which I did. Great. Then I discovered that my unit test that
fires off thousands of little processes takes about 500ms to run each process
where it used to take a few milliseconds. The even weirder thing is that every now
and again when I run it it goes at normal speed, but only occasionally. WTF? I’ve
spent all day on this and I’m starting to tear my hair out. Any ideas what could
account for this?

Just a few wild guesses: compiler switches (optimization), linking
(static vs. shared), compiler brand (aren’t binary distros compiled
with MinGW?), virus scanner, disk activity…

Kind regards

robert

On 14 Sep 2011, at 17:02, Robert K. wrote:

robert


remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Good suggestions Robert, thanks. I’m experimenting with static linking
and other things. The binary distro is indeed MinGW but the ruby source
code package seems to be set up for VS. I don’t know how the binary
distro gets it to work with MinGW.

On Wed, Sep 14, 2011 at 6:19 PM, James F.
[email protected] wrote:

Good suggestions Robert, thanks. I’m experimenting with static
linking and other things. The binary distro is indeed MinGW but
the ruby source code package seems to be set up for VS. I
don’t know how the binary distro gets it to work with MinGW.


Phillip G.

gplus.to/phgaw | twitter.com/phgaw

A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
– Leibniz