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]

[patch] libitm: Fix race condition in dispatch choice at transaction begin.


This patch fixes a race condition in how transactions previously chose
the dispatch at transaction begin:  default_dispatch in retry.cc was
read by transaction before they became either serial or nonserial
transactions (with the serial_lock).  A concurrent change of
default_dispatch was possible to lead to a transaction starting with
some out-of-date dispatch that were potentially incompatible with the
actual current dispatch, leading in turn to all sorts of synchronization
failures.
This is fixed by this patch by moving the serial_lock acquisiton into
the dispatch choice code.

Tested on ppc64 with microbenchmarks.  OK for trunk?

Attachment: patch5
Description: Text document


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