Re: Singleton instances and multithreading
Re: Singleton instances and multithreading
- Subject: Re: Singleton instances and multithreading
- From: Rob Rix <email@hidden>
- Date: Wed, 11 Jul 2001 23:33:48 -0400
As for messaging the object. It's not a problem in and of itself. There
will be the usual issues of making sure the object properly obtains locks
for access to data which two competing threads are trying to access, but
these are all basic threading issues. Just make sure your object(s)
follow the rules for being used in a multi-threaded environment, and you'
ll be fine.
Well, only the singleton instance will be able to change its data, but
others will access it for reading (it checks the state of some of the file
system).
So, will I need locks when reading from it, or just writing?
-- Rob
Man is a rational animal who always loses his temper when he is called
upon to act in accordance with the dictates of reason. - Oscar Wilde