This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Java: hashtable synchronization for PowerPC


Bryce McKinlay <bryce@waitaki.otago.ac.nz> writes:

> I added an "isync" instruction as a read barrier for
> _Jv_ThreadSelf. Although the programming environments manual makes no
> mention of isync being required to enforce ordering of data reads on
> multiprocessors, the compare and swap implementation in glibc uses it,
> and I came across this message which argues that it is necccessary:
> 
> http://sources.redhat.com/ml/libc-alpha/2001-05/msg00029.html
> 
> The "isync" does slow down the hash lookup substantially on my
> powerbook (mpc7410), but it is still a lot faster than using PPC
> pthread_self.

Actually, that message was somewhere between "badly worded" and "flat
wrong".  After some further discussion:

http://sources.redhat.com/ml/libc-alpha/2001-05/msg00122.html
http://sources.redhat.com/ml/libc-alpha/2001-05/msg00125.html

it was explained that actually the isync was being used in place of
sync, because sync is _slower_ and provided more synchronisation than
is necessary to acquire a lock.  sync acts as a memory barrier on
every processor, while isync is a local operation only.

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]