From owner-freebsd-threads@FreeBSD.ORG Wed Mar 3 22:43:12 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E6D3816A4CE; Wed, 3 Mar 2004 22:43:12 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81C2643D39; Wed, 3 Mar 2004 22:43:12 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i246hBbN024491; Thu, 4 Mar 2004 01:43:11 -0500 (EST) Date: Thu, 4 Mar 2004 01:43:11 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Peter Grehan In-Reply-To: <4046BB39.9050608@freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: User-space context switch and floating-point X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2004 06:43:13 -0000 On Thu, 4 Mar 2004, Peter Grehan wrote: > > how do you generate code that does: > > > > double x, y; > > > > ... > > x = y * 1.5 * sqrt(2.25) - 3.15 + pthread_mutex_lock(&m) + 1.25; > > Substitute integers for float and it's exactly the same problem > and handled in the same way: the caller saves registers it is using > for intermediate results prior to the mutex_lock and restores them > on return according to the calling convention. So if the caller saves the registers before pthread_mutex_lock(), why do they also need to be saved by _thr_getcontext (which may be a result of pthread_mutex_lock() in this example)? -- Dan Eischen