From owner-freebsd-arch Mon Jan 7 14:40:13 2002 Delivered-To: freebsd-arch@freebsd.org Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by hub.freebsd.org (Postfix) with ESMTP id CD52F37B405 for ; Mon, 7 Jan 2002 14:40:09 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020107224009.WPCK24940.rwcrmhc53.attbi.com@InterJet.elischer.org>; Mon, 7 Jan 2002 22:40:09 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id OAA44328; Mon, 7 Jan 2002 14:34:07 -0800 (PST) Date: Mon, 7 Jan 2002 14:34:05 -0800 (PST) From: Julian Elischer To: Nate Williams Cc: Daniel Eischen , Dan Eischen , Peter Wemm , Archie Cobbs , Alfred Perlstein , arch@FreeBSD.ORG Subject: Re: Request for review: getcontext, setcontext, etc In-Reply-To: <15418.992.515777.618882@caddis.yogotech.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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