The official MM/Allaire line is that shared-scope variables should be locked by scope 
and not by name (it's in the Knowledge Base).  

Yes, locking by name should be faster, if you coordinate it right - remember that 
locking doesn't lock anything, it merely coordinates access to the variables.

In my opinion, locking by scope is for safety reasons, and it's worth it.

Chris Norloff

---------- Original Message ----------------------------------
from: cf refactoring <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
date: Mon, 26 Nov 2001 08:09:16 -0800 (PST)

>There's something that's been buggin me:
>
>Is NAME LOCKING sufficient for session variables?
>
>A best practice in CF is to always lock session
>variable access, but it's not really clear whether
>  1) NAME locking is sufficient or 
>  2) should we always lock with SCOPE=SESSION?
>
>To me, the answer seems to depend on how shared memory
>is managed in CF. If session scope memory is managed
>as an entire block, then we have to use SCOPE=SESSION,
>because different user sessions can corrupt each
>other. On the other hand, if session scope memory is
>managed variable by variable, then we only need to
>worry that a single variable is not simultaneously
>accessed by two different threads, in which case a
>NAME lock would be sufficient.
>
>Are there any MACROMEDIA folks out there who know
>enough about CFAS internals to answer this?
>
>=====
>I-Lin Kuo
>Macromedia CF5 Advanced Developer
>Sun Certified Java 2 Programmer
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to