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

2012-02-14 Thread Richard Henderson
[ bkoz, see below ] On 02/14/2012 04:48 AM, Torvald Riegel wrote: > BTW, why can we assume that the dispatch objects are initialized before > we run any transactions (e.g., from within a constructor of another > static object)? Or is this the library initialization problem that we > still have t

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

2012-02-14 Thread Torvald Riegel
On Mon, 2012-02-13 at 15:12 -0800, Richard Henderson wrote: > On 02/13/2012 03:03 PM, Torvald Riegel wrote: > > -// The default TM method used when starting a new transaction. > > -static GTM::abi_dispatch* default_dispatch = 0; > > +// The default TM method used when starting a new transaction. I

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

2012-02-13 Thread Richard Henderson
On 02/13/2012 03:03 PM, Torvald Riegel wrote: > -// The default TM method used when starting a new transaction. > -static GTM::abi_dispatch* default_dispatch = 0; > +// The default TM method used when starting a new transaction. Initialized > +// in number_of_threads_changed() below. > +static std

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

2012-02-13 Thread Torvald Riegel
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