ReaderWriterLock

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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.
 
Back
Top