[committed] Add locking semaphore to sysdep/pa/locks.h
John David Anglin
dave@hiauly1.hia.nrc.ca
Tue Jan 3 21:37:00 GMT 2006
> I certainly agree that this patch is a good idea.
>> But note that the current gc7alpha versions use atomic_ops from
>> http://www.hpl.hp.com/research/linux/atomic_ops
>> to do this sort of stuff, in my (biased) opinion in a significantly
> better way.
Thanks. I will take a look when I get a chance.
> (Most importantly, it specifies memory ordering semantics, which tend to
> be critical in getting this stuff both correct and fast. More to the
> point here, it has a CAS emulation on PA that uses more than one lock.
> Admittedly, this package is still imperfect; this stuff is being
> discussed in conjunction with adding thread support to C++, and that
> discussion raised some more issues.)
There was some consideration of memory ordering issues in the
patch. Hopefully, the compiler issues are covered by the "memory"
constraints in the asms. From the processor standpoint, ldcw is always
strongly ordered. The reset of the semaphore is also done with an
instruction which is strongly ordered in both PA 1.x and 2.0. It would
be interesting to compare results with your double-checked locking.
There has been some mention of this scheme in the discussions about
TLS.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
More information about the Java
mailing list