This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Java: hashtable synchronization for PowerPC
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 03 Mar 2002 13:11:26 -0800
- Subject: Re: Java: hashtable synchronization for PowerPC
- References: <3C819F82.8050806@waitaki.otago.ac.nz>
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>