This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: is it a bug of /glibc/sysdeps/arm/atomicity.h ?
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: "Hu, Boris" <boris dot hu at intel dot com>
- Cc: "Linux-Arm (E-mail)" <linux-arm at lists dot arm dot linux dot org dot uk>,"Libc-Alpha (E-mail)" <libc-alpha at sources dot redhat dot com>
- Date: Mon, 17 Feb 2003 10:49:42 -0500
- Subject: Re: is it a bug of /glibc/sysdeps/arm/atomicity.h ?
- References: <957BD1C2BF3CD411B6C500A0C944CA260216C39F@pdsmsx32.pd.intel.com>
On Mon, Feb 17, 2003 at 05:25:48PM +0800, Hu, Boris wrote:
> In /glibc/sysdeps/arm/atomicity.h
> let us consider the following scenario. Suppose there are three thread
> pathes.
> Init: *p = 0
> T1 compare_and_swap(p, 0, 1) ;
> T2 compare_and_swap(p,0,1);
> T3 compare_and_swap(p,1,2);
Yes, that function is not actually atomic. If you search the mailing
list archives for gcc@gcc.gnu.org you'll find several possible fixes;
no one's done any of them.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer