[SERVER-26538] Use C++11 thread_local for all thread-specific-data Created: 09/Oct/16  Updated: 11/Jan/21  Resolved: 03/Aug/17

Status: Closed
Project: Core Server
Component/s: Portability
Affects Version/s: None
Fix Version/s: 3.5.11

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-26537 Raise Clang, XCode and MSVC Compiler ... Closed
is depended on by SERVER-26539 Stop linking boost::thread Closed
Duplicate
is duplicated by SERVER-6737 Unify thread local storage Closed
Related
is related to SERVER-43968 Remove scons checks for storage class... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Once we have XCode 8 (see SERVER-26537), all of our toolchains will support the thread_local keyword. At that point, we can replace all of our various mechanisms for thread specific data with the C++11 keyword.



 Comments   
Comment by Githook User [ 10/Aug/17 ]

Author:

{'email': 'acm@mongodb.com', 'name': 'Andrew Morrow'}

Message: SERVER-26538 SERVER-26539 Detach from boost::thread

Also, use thread_local everywhere for our thread specific data needs
and remove the legacy support.
Branch: master
https://github.com/mongodb/mongo/commit/a8a1ea3b9367adb6d0b65a7da21fed89598ea093

Comment by Githook User [ 10/Aug/17 ]

Author:

{'email': 'acm@mongodb.com', 'name': 'Andrew Morrow'}

Message: SERVER-26538 SERVER-26539 Detach from boost::thread

Also, use thread_local everywhere for our thread specific data needs
and remove the legacy support.
Branch: master
https://github.com/mongodb/mongo/commit/a8a1ea3b9367adb6d0b65a7da21fed89598ea093

Comment by Andrew Morrow (Inactive) [ 16/Jun/17 ]

Unfortunately, it appears that destructors for non-trivial thread_local's do not work on solaris (at least not with gcc 5.4). That makes it impossible for us to implement this, at least until we go ahead and drop support for solaris.

Generated at Thu Feb 08 04:12:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.