Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Mar 2004 01:43:11 -0500 (EST)
From:      Daniel Eischen <eischen@vigrid.com>
To:        Peter Grehan <grehan@freebsd.org>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: User-space context switch and floating-point
Message-ID:  <Pine.GSO.4.10.10403040141100.22656-100000@pcnet5.pcnet.com>
In-Reply-To: <4046BB39.9050608@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10403040141100.22656-100000>