At 12:19 PM 12/20/00 -0500, Bud wrote:
>First, can you set anything inside of a read only lock?
Yes, you can do anything you like inside a lock. CFLOCK is "advisory locking" which
means all it does is check a flag to see if anyone else has an EXCLUSIVE lock on the
same resource. If so, it waits until the EXCLUSIVE lock is freed. Then it marks a flag
that says "someone is reading this resource". This flag is ignored by other read
locks, and will force an exclusive lock to wait until it is freed.
If you don't use locks together, they do nothing. Only another lock will wait for the
flag to be freed. The system never does anything special to make a thread 'wait' -
only the CFLOCK tag does.
And you can put anything you like inside a lock, even, wastefully, an entire page.
>On 12/20/00, Evan Lavidor penned:
>>Are you saying that if I do the following:
>>
>> <cflock scope="application" timeout="30" type="readonly">
>> <cfset variables.myvariable = application.myvariable>
>> </cflock>
>
>
>>and then later on down the page I do the following:
>>
>> <cfif variables.myvariable GT 10>
>> do something
>> </cfif>
>>
>>then I haven't solved the locking "issue"? I thought that by setting my
>>application variables to local variables within a lock, I could now
>>reference the local variables with abandon and not have to worry about
>>locking any more. Is this not the case?!?
>
>I would think that would be OK. But based on the part of Peter's
>e-mail you're probably responding to, I'm not sure:
>
>>On a related note, if I have automatic read locking enabled for
>>Application scope and I assign a local Variable to an Application
>>variable, it will essentially make a copy to the pointer. Is CF
>>smart enough then to automatically lock accesses to this local
>>Variables, which is pointing into Application space?
>>
>>< !--- automatic read locking is ON for Application variables --->
>>< cfset myvar = Application.bigvar>
>>< cfoutput> #myvar# </cfoutput> < !--- <<<=== IS THIS
>>AUTOMATICALLY LOCKED?? --->
>
>
>Is that true? It only makes a pointer to the application variable?
>So, writing <cfoutput>#myvar#</cfoutput> is in essence writing
><cfoutput>#application.bigvar#</cfoutput>?
>
>That makes little sense to me and seems to partially defeat the whole
>purpose of local variables.
>--
>
>Bud Schneehagen - Tropical Web Creations
>
>_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>ColdFusion Solutions / eCommerce Development
>[EMAIL PROTECTED]
>http://www.twcreations.com/
>954.721.3452
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists