"semedao" <se*****@community.nospamwrote in message
news:uX**************@TK2MSFTNGP06.phx.gbl...
Hi,
what is the best way to Synchronized threads on classes that use or
inherit from Generics ? (Dictionary for example)
Thanks.
There's no difference for this in generic types: don't allow direct access
to the collection by client code, and use Lock to protect access to the
collection.
(and where is the *Class*.Synchronized method for them ?)
The synchronized wrapper classes just don't work well. While synchronizing
single method access works OK, you still need to use explicit locking to
protect iteration, which makes the synchronized wrappers pretty useless.
David