singleton

Thread-Safe Initialization of a Singleton

There are a lot of issues with the singleton pattern. I'm totally aware of that. But the singleton pattern is an ideal use case for a variable, which has only to be initialized in a thread safe way. From that point on you can use it without synchronization. So in this post I discuss different ways to initialize a singleton in a multithreading environment. You get the performance numbers and can reason about your uses cases for the thread safe initialization of a variable.

Read more
Comments 6Views: 10510

Thread-Safe Initialization of Data

In case the data is not modified when shared between threads, the story is simple. The data has only to be initialized in the thread safe way. It is not necessary to use an expensive lock for each access.

Read more
Comments 6Views: 3664

My Newest E-Books

Latest comments

Subscribe to the newsletter (+ pdf bundle)

Blog archive

Source Code

Visitors

Today 380

All 459293

Currently are 191 guests and no members online