Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jan 2002 13:24:00 -0700
From:      Nate Williams <nate@yogotech.com>
To:        Julian Elischer <julian@elischer.org>
Cc:        Daniel Eischen <eischen@pcnet1.pcnet.com>, Nate Williams <nate@yogotech.com>, Dan Eischen <eischen@vigrid.com>, Peter Wemm <peter@wemm.org>, Archie Cobbs <archie@dellroad.org>, Alfred Perlstein <bright@mu.org>, arch@FreeBSD.ORG
Subject:   Re: Request for review: getcontext, setcontext, etc
Message-ID:  <15418.992.515777.618882@caddis.yogotech.com>
In-Reply-To: <Pine.BSF.4.21.0201071211360.28827-100000@InterJet.elischer.org>
References:  <Pine.SUN.3.91.1020107144700.10060A-100000@pcnet1.pcnet.com> <Pine.BSF.4.21.0201071211360.28827-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> >   Thread 1:
> >   ---------
> >   /* munch some FP stuff */
> >   pthread_yield();  /* allow thread 2 to run */
> >   /* munch some more FP stuff */
> 
> On which thread's behalf is this later munching being done?

The original thread, per the comment's above.

> > Assume that pthread_yield only saves the FP control word (which
> > is what it does currently in libc_r).
> > 
> >   Thread 2:
> >   ---------
> >   /* FP munchy munchy */
> >   pthread_yield();   /* allow thread 1 to run */
> >   /* FP munchy munch munch */
> 
> ditto.. Are you suggesting that the FPU continues to operate on behalf 
> of the previous thread after the yield?

That's not the way threaded programs work.  The yield's in the code
allow a context switch to occur (if necessary), so that the other
threads can do some work.

Yield's are not strictly necessary, but often they can cause programs to
behave better.

Out of curiousity Julian, have you written much threaded code?


Nate

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15418.992.515777.618882>