|
Boost : |
From: Jason Hise (chaos_at_[hidden])
Date: 2005-07-16 13:21:34
Background:
Since the first version of my singleton library was rejected, I have
been designing a new singleton library from the ground up. I feel that
this is necessary because the first version was not designed with the
concerns of threading in mind, and such concerns cannot easily be
addressed efficiently as an afterthought. The new design should
hopefully be able to handle threading effectively without introducing
any overhead for the single threaded model.
Question:
With the new design, I am adding a policy to control exactly what
happens if creation is attempted while the singleton instance exists.
The options thus far include throwing an exception, doing nothing, or
destroying and recreating the singleton, depending on the policy used.
Does it make sense to have a similar policy for what happens when
attempting to destroy an already destroyed instance? I can think of a
few options that would make sense, such as doing nothing, throwing an
exception, asserting, or creating the instance so that it can be
re-destroyed, but I do not know if these would actually be useful enough
to justify a point of customization. Thoughts?
-Jason
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk