Stefan Reinalter on Nostr: PSA: If your platform offers a native way to declare variables in thread-local ...
PSA:
If your platform offers a native way to declare variables in thread-local storage (e.g. __declspec(thread) or __thread), use this instead of the C++ standardized thread_local.
The native version often offers superior codegen, even for simple types like int.
#cpp
Published at
2024-02-05 13:14:22Event JSON
{
"id": "59d26ae0bd3ba232329d5e90d8bd39d2f9e43d2cca7453c8d9477b77405cdecd",
"pubkey": "bce49b053c3f4f64e3fa19ab0544c6470d9b0073adc765bc27f6c5de024eb13d",
"created_at": 1707138862,
"kind": 1,
"tags": [
[
"t",
"cpp"
],
[
"proxy",
"https://mastodon.gamedev.place/users/molecularmusing/statuses/111879052523337187",
"activitypub"
]
],
"content": "PSA:\nIf your platform offers a native way to declare variables in thread-local storage (e.g. __declspec(thread) or __thread), use this instead of the C++ standardized thread_local.\nThe native version often offers superior codegen, even for simple types like int.\n\n#cpp",
"sig": "d0e9fd77a46193fbc27fed7d40658dfef85a1855fb1df2809867005743b16680bd61ccba1229fd808fb922b2dd759bb32a61b06ab39102afea238cb362dfd2da"
}