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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top