Hi,
The Java data structures Neo uses as scopes are designed to be thread-safe. But we 
still recommend using cflock.

This is some wisdom from Tom Harwood:

"That said, our "best practices" recommendation is still to use <CFLOCK> as before to 
protect access to shared data; we recommend this for several reasons: 

o Code that is correctly locked could (assuming it is otherwise correct) be proved to 
do what it's intended to do. 
o Code that is not correctly locked may give different results depending on what other 
requests may be concurrently modifying shared data; no theorem can account for this. 
o Code that is correctly locked can be run on a CF MX installation or a CF5 
installation. 
The <CFLOCK> tag has low overhead. 

My own $.02 -- I have written server software for 17 years. I've done operating 
systems (IBM VM/ESA 2.0), databases (Model 204 and Progress), ColdFusion, and other 
systems that ran many threads through shared data. Correct and fast access to shared 
data is one of my first and last design considerations whenever I design code. 

"Locking -- it's not just the law, it's a really, really good idea." :) 

Hope this helps, and best regards, 
--
Tom Harwood
Neo Compiler/Runtime Development 
Please respond to this forum, so that others can participate and share. Thanks! 



Attachments: <!---
    This code will not make Neo explode or turn into a frog
    or anything -- to my mind that is *bad.*  A core dump
    is a better thing than silently corrupted data.
--->

<!--- no CFLOCK --->
<cfset session.cartTotal = session.cartTotal + currentPrice>
<!--- 
    There really is enough time between the right-hand side 
    read of session.cartTotal and the left-hand-side write
    for another request to get in before us and modify
    session.cartTotal; our CFSET will step on that other
    request's data.  That is bad.
--->
"

Hope that helps,
Christine
 


-----Original Message-----
From: Gyrus [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 4:49 PM
To: CF-Talk
Subject: Re: CF Wishlist


> From: "Raymond Camden" <[EMAIL PROTECTED]>
>
> cflock is _not_ necessary for memory issues anymore. You still need it
> for logical reasons. For example:
>
> application.x = application.x + 1

Whoah - not been following this thread closely, but did I miss
something? You don't need to habitually lock Session, Server and
Application variables anymore in CFMX?

- Gyrus

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- [EMAIL PROTECTED]
work: http://www.tengai.co.uk
play: http://www.norlonto.net
- PGP key available
~~~~~~~~~~~~~~~~~~~~~~~~~~~~


______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.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