I read that there was a new keyword in C++: it’s __thread from what I’ve read.
All I know is that it’s a keyword to be used like the static keyword but I know nothing else. Does this keyword just mean that, for instance, if a variable were declared like so:
__thread int foo;
then anything to do with that variable will be executed with a new thread?
It’s
thread_local, not__thread. It’s used to define variables which has storage duration of the thread.thread_localis a new storage duration specifier added in C++0x. There are other storage duration : static, automatic and dynamic.From this link:
I think the introduction of this keyword was made possible by introducing a standardized memory model in C++0x: