Date: Mon, 7 Jan 2002 14:34:05 -0800 (PST) From: Julian Elischer <julian@elischer.org> To: Nate Williams <nate@yogotech.com> Cc: Daniel Eischen <eischen@pcnet1.pcnet.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: <Pine.BSF.4.21.0201071431020.28827-100000@InterJet.elischer.org> In-Reply-To: <15418.992.515777.618882@caddis.yogotech.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 7 Jan 2002, Nate Williams wrote: > > > 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? yes, in control apps but My question was maybe misstated/misunderstood. "Dan, In your example, are you indicating more munching on behalf of thread 2 or continued munching in the FPU as a carryover from thread1? (lazy context swapping?)" I understand the concepts I was just not sure which he was representing.. > > > 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?Pine.BSF.4.21.0201071431020.28827-100000>