Standard C++ transactional memory status

只谈情不闲聊 提交于 2019-12-23 13:27:30

问题


What is the current status of transactional memory proposal for C++17. Is it going to be included in the standard, aimed at being included in some future version of standard C++ or is only an experimental proof-of-concept feature, with its standardization status still undetermined?

I'm asking because some of the standardization committee's documents seem to give contradictory communication here. On the one hand we have P0265R0 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0265r0.pdf) saying that transactional memory is not going to be standardized, on the other hand - there's a N4492 paper by Stroustrup (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4492.pdf) with transactional memory listed in C++17 feature list.


回答1:


Shortly enough: the transactional memory TS is already published, and a second version is being developed. However, the committee does not plan to include it in the standard in the near feature. There are several reasons for this choice:

  • There isn't enough implementation experience. Only g++ implements it since GCC6. The goal of TSs is partly to gather implementation and user experience, so such a big feature is still too « immature » with regard to that.

  • Not every target supports transactional memory, and it has a high implementation cost while not everyone needs it. For these reasons, the committee is apparently unsure whether the TS should be part of the main C++ standard at all. It might as well forever live as a TS.

  • Moreover, not everyone believes that every feature of the transactional memory TS are worth being included in the main C++ standard. Some find that synchronized is the main feature, while other believe that atomic blocks are the real game changer. The TS does add another cognitive overhead that library implementers will have to deal with (as well as several new keywords, which isn't generally seen as a good thing).



来源:https://stackoverflow.com/questions/39035856/standard-c-transactional-memory-status

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!