Basically, it seems to come down to this: if you are storing a value in
a shared-memory scope, and you are positive that it will only be written
to once, then you don't need to lock reads or writes to this variable.
If there is any chance that it could be written to more than once, then
you must lock the write with an exclusive lock and lock reads with a
readonly lock. It's not enough to only lock the write because you could
still end up with a situation where an unlocked read happens while the
variable is being written to. Is that in the ballpark?


It makes logical sense, but as the example I just posted shows, sometimes letting a variable be written twice is actually better.

Matt Liotta
President & CEO
Montara Software, Inc.
http://www.MontaraSoftware.com
(888) 408-0900 x901


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to