|
|
|
|
|
by jolmg
2104 days ago
|
|
I think best practice among languages that support dynamic scoping is to only make use of it for global variables. As I understand it, one should only read or shadow, not modify, these variables. Since that's the case, besides the thread issue you mentioned, I'm not sure this solution is lacking. I don't know much C++, though, so I might be missing something. |
|
In this implementation, the threads will corrupt the data structure and result in undefined behavior.