Boost logo

Boost :

From: Jason Hise (chaos_at_[hidden])
Date: 2005-01-11 18:15:23


Dave Handley wrote:

>Let me give you an example where you may want a dead reference exception rather than a phoenix singleton. Let's say you have a singleton that performs a client access to a database. When the client is started up, it asks for a username and password, and logs the client access in the database. You definitely would not want this to go through a phoenix singleton because of the side-affects. Making OnDeadReference a policy of the lifetime policy probably makes a lot of sense, since you have essentially implemented the phoenix singleton as an extra to the lifetime policy in the dependency model.
>
>
Alrighty, I'll start work on splitting that off into its own GetInst policy.

>The problem with threading is that it is up to the OS to define the threading system. This means that threading is usually non-portable.
>
>
I don't think it is necessary for the library itself to be
multi-threaded. I think it just needs to have a hook that allows client
code to make it thread safe. The interface for such a hook would be the
only thing provided (the default single threaded policy defining all the
usable methods and leaving them all blank), and the client could then
implement an OS specific thread safety policy and pass it in. A
dependency on a whole threading library doesn't seem like a good idea
for something that only some clients might want.

-Jason


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk