I would agree...it always seemed to be bashed into everyone's head that
you "always lock everything" in the shared-memory scopes.  I think that
I do have some idea of how and why to lock, even in CFMX and even if my
old instinct was to obey the party line and lock everything.

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?


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Matt Liotta
> Sent: Wednesday, December 03, 2003 3:38 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFCDev] Basic CFC Design Question
> 
> 
> Not to digress into arguably useless discussions, but the note below 
> reminded me why I took such offense to people coming up with 
> rules like 
> "you must always lock shared variable scopes" in the pre-CFMX 
> days. All 
> those people who memorized that rule are now confused with 
> CFMX because 
> there is no rule. If people had taken the time to explain why locking 
> needed to happen then people would be better prepared to handle the 
> situation with CFMX, which of course now requires people understand 
> when and where to lock.
> 
> -Matt
> 

----------------------------------------------------------
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