LWN.net Logo

Transactional memory for GCC 4.7.0

Transactional memory for GCC 4.7.0

Posted Mar 22, 2012 16:12 UTC (Thu) by slashdot (guest, #22014)
Parent article: Transactional memory for GCC 4.7.0

Wouldn't it be better to have the __transaction statement also specify a mutex, so that if HTM is not available the code can fallback to taking the mutex instead?

With the current proposal, the code contains no information on which transactions can conflict with each other, meaning that if HTM is not available, either a full STM implementation or a global mutex would have to be used, and that's probably a serious performance issue either way.

Of course, one may then skip the new syntax entirely, and just add a mutex attribute to enable lock elision...


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds