Re: Singleton instances and multithreading
Re: Singleton instances and multithreading
- Subject: Re: Singleton instances and multithreading
- From: Rob Rix <email@hidden>
- Date: Thu, 12 Jul 2001 01:23:32 -0400
So, you've got to figure out if two threads can do anything which changes
state on the object. If so, then you'll need to protect them. If that's
not the case, you'll need to ask yourself if it's OK for a reader thread
to be able to interrupt the writer thread and look at potentially
inconsistent data. If that can't happen, then I'd also protect it with
locks.
Ah, okay. That explains it clearly, thanks.
I didn't realize it was quite so complicated as it is!
-- Rob
We are all in the gutter, but some of us are looking at the stars. - Oscar
Wilde