From: Jason Hise (chaos_at_[hidden])
Date: 2005-09-26 03:43:29
Anthony Williams wrote:
>Jason Hise <chaos_at_[hidden]> writes:
>>Because the singleton library is now being designed to work with shared
>>memory in addition to allowing multiple instances in a singleton_map
>>(multiton), I have a particularly difficult situation to deal with. The
>>main problem is: when a multiton exists in shared memory, who should own
>>the timeout threads associated with each instance?
>How about each process that accesses the singleton having a thread that checks
Would that thread check for timeouts for each singleton instance of the
same type, or each singleton instance of any type (that uses this
lifetime policy)? I might be able to put together a behind the scenes
timeout_registration_singleton which is unique per process and owns this
thread... but perhaps it would be better to make said singleton public?
Perhaps even make it customizable so that any 'resource' that meets a
given interface can be registered with any timeout_singleton specified
by client code? At that point it would no longer be a lifetime policy
though... although that's not necessarily a bad thing.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk