H
Herby
I am going to develop a multi-threaded application that creates many
instances of a calculator object. Consequently the DLL housing the
Calculator is to be thread safe.
Within the DLL i want some global singleton objects - these then become
accessible from all sub-objects comprising the calculator DLL. But i
only want these singletons to be accessible from anywhere within the
current calculator instance not across all calculators.
Its usual to make singletons static. But this would then make it
accessible across all concurrent instances, thus compromising my thread
safety.
How can i have a DLL instance singleton ?
instances of a calculator object. Consequently the DLL housing the
Calculator is to be thread safe.
Within the DLL i want some global singleton objects - these then become
accessible from all sub-objects comprising the calculator DLL. But i
only want these singletons to be accessible from anywhere within the
current calculator instance not across all calculators.
Its usual to make singletons static. But this would then make it
accessible across all concurrent instances, thus compromising my thread
safety.
How can i have a DLL instance singleton ?