Home All Groups Group Topic Archive Search About
Author
6 Sep 2006 2:57 PM
Roy
I use ReaderWriterLock to protect the internal state of a class instance from
multi-threaded access, should it be declared as private member or static
member of the class?

Author
6 Sep 2006 3:24 PM
Michael D. Ober
If different instances of the class don't depend on each other's internal
state, create it as a private member of the class.  If the different
instances do depend on each other's internal state (I'd hate to debug this
configuration), create it as a static member.

Mike Ober.

Show quote
"Roy" <R**@discussions.microsoft.com> wrote in message
news:B15588F6-41E9-40C0-AB2A-B5E9D998C9C6@microsoft.com...
>I use ReaderWriterLock to protect the internal state of a class instance
>from
> multi-threaded access, should it be declared as private member or static
> member of the class?

AddThis Social Bookmark Button