[M3devel] any limitations on __thread?

Jay jay.krell at cornell.edu
Wed Apr 29 16:12:37 CEST 2009


Anyone have expertise on __thread?
In particular, on Windows there is a close analog __declspec(thread) that generally would seem to work and work well, except that, per documentation, prior to Vista, it doesn't work if you are loaded with LoadLibrary (dlopen), only if the main executable uses your .so, directly or indirectly. To me that's a pretty big limitation so I wouldn't use it. I haven't seen any documentation on __thread giving this caveat though so it seems ok to use.
 
I changed m3core to use it if sample code seems to compile, link, and execute correctly with it.
 
 
 - Jay


More information about the M3devel mailing list