On Feb 11, 2008 10:53 AM, Indika Bandara Udagedara
<[EMAIL PROTECTED]> wrote:
> --- In [email protected], "Paul Herring" <[EMAIL PROTECTED]> wrote:
> > On Feb 11, 2008 5:44 AM, Indika Bandara Udagedara
> > > Is it required that variables which are ONLY READ by multiple threads
> > > needs to be protected by (mutex) locks?
> > > i.e. it is absolutely guarenteed that they will NEVER try to write to
> > > them. So is there any possibility of corruption?
> >
> > If you have a concurrent thread that may change that value, then yes,
> > you need some form of mutex.
>
> in my requirement it is guarenteed that no thread will ever write to it.
> example is program configs, which are loaded by reading a file perhaps
> by main thread. other threads won't modify them but read

If:
a) other threads are guaranteed not to be running while the configs
are being populated and
b) the configs are guaranteed not to be changed while the program is running

then you shouldn't need mutexes or any other form of access control


-- 
PJH

http://shabbleland.myminicity.com/

Reply via email to