From owner-freebsd-arch Mon Jan 7 12:24:38 2002 Delivered-To: freebsd-arch@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id 7D0F637B405 for ; Mon, 7 Jan 2002 12:24:28 -0800 (PST) Received: from caddis.yogotech.com (caddis.yogotech.com [206.127.123.130]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id NAA15005; Mon, 7 Jan 2002 13:24:01 -0700 (MST) (envelope-from nate@yogotech.com) Received: (from nate@localhost) by caddis.yogotech.com (8.11.6/8.11.6) id g07KO0e99155; Mon, 7 Jan 2002 13:24:00 -0700 (MST) (envelope-from nate) From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15418.992.515777.618882@caddis.yogotech.com> Date: Mon, 7 Jan 2002 13:24:00 -0700 To: Julian Elischer Cc: Daniel Eischen , Nate Williams , Dan Eischen , Peter Wemm , Archie Cobbs , Alfred Perlstein , arch@FreeBSD.ORG Subject: Re: Request for review: getcontext, setcontext, etc In-Reply-To: References: X-Mailer: VM 6.96 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) 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 > > 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