This one time, at band camp, Andrew Suffield said: > On Sat, Dec 10, 2005 at 01:25:22AM +0000, Stephen Gran wrote: > > > > This is because the parent and the child get the same value for rand() > > almost every time (although oddly, the first time almost always succeeds > > in getting different values, so the original test passed most of the > > time). > > That should have been your clue.
And it was, but only after some coffee this morning :/. I sort of worked up to the fact that 'works once' was PEBCAK this morning. I should probably wait until I'm awake to send rambles to the BTS. This morning, after putting srand's in the right places, I can't get it fail more than once every 40,000 runs on mips. > I have a copy of fork.t, hacked to run outside the perl source tree, > which I've tried running a whole load of times on mips and anything > else to hand... it hasn't failed yet. My best guess is that > /dev/urandom on the buildd isn't working right, but it's sheer > guesswork since I can't actually look at the thing. The point that I was originally trying to make was that, really, if you are testing fork, maybe using rand isn't the best test for it. rand does always have a non zero chance of collision, while fixed numbers don't. Take care, -- ----------------------------------------------------------------- | ,''`. Stephen Gran | | : :' : [EMAIL PROTECTED] | | `. `' Debian user, admin, and developer | | `- http://www.debian.org | -----------------------------------------------------------------
signature.asc
Description: Digital signature