This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Avoid unnecessary futex_wake syscalls when all threads are busy waiting
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Jul 2011 12:05:43 +0200
- Subject: Re: [RFC] Avoid unnecessary futex_wake syscalls when all threads are busy waiting
- References: <20110715093744.GJ2687@tyan-ft48-01.lab.bos.redhat.com> <4E20101E.108@gnu.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jul 15, 2011 at 12:02:06PM +0200, Paolo Bonzini wrote:
> On 07/15/2011 11:37 AM, Jakub Jelinek wrote:
> >While __sync_lock_test_and_set isn't a full barrier on all targets,
> >I hope it doesn't matter, because the inline caller has already done one
> >__sync_val_compare_and_swap which is a full barrier.
>
> Why not take the occasion to add the __sync_swap extension that
> clang added already?
I think Andrew and Aldy are already extending all the __sync_* builtins
to have extra argument with required barrier behavior bits for C++ memory
model.
Jakub