Date: Mon, 14 Jan 2002 08:53:30 +1100 From: Peter Jeremy <peter.jeremy@alcatel.com.au> To: Alfred Perlstein <bright@mu.org> Cc: Kelly Yancey <kbyanc@posi.net>, Nate Williams <nate@yogotech.com>, Terry Lambert <tlambert2@mindspring.com>, Daniel Eischen <eischen@pcnet1.pcnet.com>, Dan Eischen <eischen@vigrid.com>, Peter Wemm <peter@wemm.org>, Archie Cobbs <archie@dellroad.org>, arch@FreeBSD.ORG Subject: Re: Request for review: getcontext, setcontext, etc Message-ID: <20020114085330.B38605@cirb503493.alcatel.com.au> In-Reply-To: <20020110135217.M7984@elvis.mu.org>; from bright@mu.org on Thu, Jan 10, 2002 at 01:52:17PM -0800 References: <15421.64170.308581.606485@caddis.yogotech.com> <Pine.BSF.4.21.0201101309200.6849-100000@gateway.posi.net> <20020110135217.M7984@elvis.mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 10, 2002 at 01:52:17PM -0800, Alfred Perlstein wrote: >1) Is atomicity required? (looks like a "no") >2) Are states like FP usage trackable from userspace? > (looks like a "yes" with some kernel help) I gather you are thinking of a userland approach like: if (thread_has_used_FP) { save_FP_context(curthread); mark_FP_unused(); } save_nonFP_context(curthread); restore_nonFP_context(newthread); if (FP_is_used(newthread)) pass_FP_context_to_kernel(newthread); curthread = newthread; Since FP status is per-CPU, this needs atomicity to an extent: You must ensure that the active thread does not migrate between CPUs between the "thread_has_used_FP" test and following save. I agree this is unlikely, but it needs to be catered for. Peter 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?20020114085330.B38605>