> Sam,
>
> I think that a number of people don't understand race
> conditions. So tell me, what would you not lock?
>

Ok, so I'm not Sam, but I'm going to respond anyway. Is your contention
that since most people don't understand race conditions, then they
should lock everything? If so, that is a perfectly valid reason, just
not one I agree with. You never stated this was your reason, and now we
know.

As it stands, I think it would be MUCH easier to explain race
conditions, then to describe code like so:

<cflock scope="application" type="readOnly" timeout=3>
<cfif not isDefined("application.init")>
<cfset needInit = true>
</cfif>
</cflock>

<cfif isDefined("needInit")>
<cflock scope="application" type="exclusive" timeout=3>
<cfif not isDefined("application.init")>
bunch of sets
<cfset application.init = true>
</cfif>
</cflock>
</cfif>


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to