[Python-Dev] test_fork1 on SMP?

Thomas Wouters thomas@xs4all.net
Thu, 27 Jul 2000 09:21:44 +0200

On Thu, Jul 27, 2000 at 12:32:02AM -0400, Tim Peters wrote:
> [Thomas Wouters]
> > I have also seen test_fork1 failures on BSDI, using a SMP machine, but
> > I haven't tried it on non-SMP (we don't have too many of those).
> > However, all our BSDI kernels are the same, having been built for SMP.
> > Meetings permitting (which is doubtful, today :-() I'll see if I can
> > pin that down.
> >
> > It would, however, be fairly peculiar if test_fork1 breaks on all
> > SMP-supporting systems... I don't really recall a reason for thread
> > semantics to change reliably based on kernel/cpu settings, and it would
> > be silly for them to do so! But I'll admit threads are silly, period ;-)

> Silly?  Without threads your clothes would fall off <wink>.

Clothes ? What clothes ? I'm stuck in meetings all day, remember, and those
require a suit and tie. And I have suit nor tie ;)

> I wonder whether the "fork" part is a red herring here.  It's extremely rare
> to see a thread bug that actually requires a multi-headed machine to trigger
> (in fact, I don't believe I've ever seen one), but the nature of races in
> flawed threaded code is often such that you're a million times more *likely*
> to hit a bad timing window on a multi-headed machine than on a time-sliced
> single-headed box. 

Actually, I got the impression the 'bug' wasn't only present on multi-headed
Linux machines with an SMP kernel, but single-headed Linux machines with an
SMP kernel as well. You see, in Linux, the extra logic required for SMP is
optional, at compile time. It changes a lot in the scheduler, but I'm not
sure if it should be visible from outside. I haven't actually tested it on a
UP machine with SMP kernel, though.

And anyway, I thought the test_fork1 test tested for fork() behaviour in
threads. It spawns a thread, fork()s one of those threads, and tests to see
if the other threads still exist after the fork(), in the new child. The
entire test is done in Python code, so how the scheduler and/or race
conditions come into play isn't too obvious to me. Except of course the
whole test if flawed.

> > 6-AM-and-preparing-for-a-full-10-hour-day-of-meetings-:-S-ly y'rs,

> So long as you still put in your 18 hours on Python today, we're happy to
> let you engage in all the recreational activities you like <wink>.

I'll clock the hours I spend thinking about Python in those meetings, so not
to worry ;)

Dreaming-Python-makes-it-24h-a-day-ly y'rs,

Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!