From owner-freebsd-arch Thu Jan 10 11:21:30 2002 Delivered-To: freebsd-arch@freebsd.org Received: from pintail.mail.pas.earthlink.net (pintail.mail.pas.earthlink.net [207.217.120.122]) by hub.freebsd.org (Postfix) with ESMTP id D3EE637B42C for ; Thu, 10 Jan 2002 11:21:05 -0800 (PST) Received: from pool0030.cvx22-bradley.dialup.earthlink.net ([209.179.198.30] helo=mindspring.com) by pintail.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 16Okl1-0007E9-00; Thu, 10 Jan 2002 11:20:59 -0800 Message-ID: <3C3DE998.44DCFA07@mindspring.com> Date: Thu, 10 Jan 2002 11:20:56 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Bruce Evans Cc: Peter Wemm , Nate Williams , Dan Eischen , Archie Cobbs , Alfred Perlstein , arch@FreeBSD.ORG Subject: Re: Request for review: getcontext, setcontext, etc References: <20020111000813.N12236-100000@gamplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Bruce Evans wrote: > On Thu, 10 Jan 2002, Peter Wemm wrote: > > Nate Williams wrote: > > > Hmm, IIRC, Java's green threads saves the FP context everytime it does a > > > thread switch, since it has no way of knowing if the thread was doing FP > > > context. Is there a way to force get/setcontext to always/conditionally > > > save the FP context, for applications that either know they need to have > > > it saved? > > > > Exactly the problem. Userland cannot tell if it has touched FP or not > > except by touching it. This is where a system call is more efficient since > > to save FP context you are doing trap recovery on top of doing the work. > > Actually, userland can look at the state bit in %msw (on i386's) to > tell if it can look at the state without trapping. However, this is > not very useful. The state will often be in the kernel, and then > userland will have to trap to the kernel too look at it. The trap > may as well be a syscall that fetches all the state. How onerous would it be to look at the register in the kernel before returning to user space, following a context switch? I really don't think the lazy task switching FPU state saving needs to care about threads, only about processes... and once the bit is set, it's set, right? -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message