Re: [eigen] Help on solving a race condition |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Help on solving a race condition*From*: Ilja Honkonen <ilja.honkonen@xxxxxxxxxxx>*Date*: Mon, 11 Jun 2012 22:24:12 +0300*Cc*: John Tytgat <John.Tytgat@xxxxxxxx>

static std::ptrdiff_t m_l1CacheSize = 0; static std::ptrdiff_t m_l2CacheSize = 0; static bool initialized = false; if(!initialized)

....

There is no guarantee that the "initialized = true" gets seen by another thread after the update to "m_l1CacheSize" or "m_l2CacheSize" gets seen by that thread. The order of the stores can be differently perceived by

....

t1 sees initialize == false and does m_l1CacheSize = manage_caching... .... initialized = true; "after" that t2 does m_l1CacheSize = 0; .... but already sees initialized == true; resulting (possibly) in obviously wrong sizes of 0. Ilja

**References**:**[eigen] Help on solving a race condition***From:*Gael Guennebaud

**Re: [eigen] Help on solving a race condition***From:*Hauke Heibel

**Re: [eigen] Help on solving a race condition***From:*Brad Bell

**Re: [eigen] Help on solving a race condition***From:*Gael Guennebaud

**Re: [eigen] Help on solving a race condition***From:*Rhys Ulerich

**Re: [eigen] Help on solving a race condition***From:*Gael Guennebaud

**Re: [eigen] Help on solving a race condition***From:*Gael Guennebaud

**Re: [eigen] Help on solving a race condition***From:*John Tytgat

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Help on solving a race condition** - Next by Date:
**Re: [eigen] Help on solving a race condition** - Previous by thread:
**Re: [eigen] Help on solving a race condition** - Next by thread:
**Re: [eigen] Help on solving a race condition**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |