|
Boost : |
From: John Maddock (John_Maddock_at_[hidden])
Date: 2000-06-08 06:49:26
Dietmar,
>Note that a program using an MT-unsafe component cannot have a higher
>MT-safety level except when the MT-unsafe component only uses MT-strong
>components! Thus, this level of MT-safety should best be avoided.
Agreed, at that level use of that object in a multithreaded program is
basically broken, although possibly if all instances of the type are
confined to a single thread then it should be OK.
>We should also be careful with terms "object" and "class": The above
>sentence should probably be "Unrelated instances of the class can be
>safely used in separate threads." Objects have an identity and it makes
>no sense to speak of "unrelated instances of the object" because all
>instances would share the same identity.
Yes, I was guilty of woolly language there, as you say I meant "type" not
"object".
>Especially for the higher levels of MT-safety, I think it is necessary
>to also have a component level MT-safety guarantee to avoid dead lock
>situations. Something like this:
>
> Using multiple objects of possibly multiple classes in the component
> from multiple threads will not result in a dead lock.
Good point I forgot about deadlocks - I think that at all levels (other
than zero), there should never be a deadlock arising from behaviour that is
guarenteed at that level.
Thanks for the feedback!
- John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk