Quantcast
Channel: The Old New Thing
Viewing all articles
Browse latest Browse all 24428

re: What does INIT_ONCE_CTX_RESERVED_BITS mean?

$
0
0

I've never understood the point of this pattern in the first place.  If you know you're going to need exactly one of something that's going to be used by multiple threads, the smart thing to do is to create it exactly once *before you spawn the multiple threads that are going to need it*.  No possibility of race conditions that way, and no weird, bug-prone complexity at getting the just-in-time initialization to work right.

[This is difficult when your code doesn't control the thread creation. -Raymond]

Viewing all articles
Browse latest Browse all 24428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>