This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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] | |
We could do a non-atomic store I guess (provided __cxa_abort is never called by mistake when the the var has been initialized already and the first byte set), but then we'd need to do an unconditional FUTEX_WAKE. I guess we could use instead __sync_lock_test_and_set aka. atimic exchange, to atomically swap in 0 and read previous value to see if we need FUTEX_WAKE or not. The unconditional FUTEX_WAKE is IMHO more costly than __sync_lock_test_and_set and conditional FUTEX_WAKE.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |