Hi all,

I am not sure whether the member variables of singleton class should be protected for multhread since I just read some code from colleague. I think it should be.

Any shared resources should be protected somehow. If the singleton is a singleton across threads and not a singleton per thread then you do need to think about concurrency errors.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.