> (Slightly OT) This is something I've wondered about for a while.  It's
> obvious why you need to CFLOCK writes to the application scope since
> there are likely to be many users accessing application scope
> variables all over the place.  I've heard that locking session
> variables is important if you use frames or if a user were to
> repeatedly hit the refresh button on a page where session variables
> are written to unlocked.  My question is, does CFLOCK scope=session
> type=exclusive impact performance significantly?  Or for that matter,
> would a type=readonly impact it as well?  I don't know enough about
> CFLOCK and whether it's locking just that users' spot of shared memory
> or the entire area of shared memory where session vars are stored.  If
> it's the former I'd guess the performance impact is negligible, and in
> the case of the latter I'd guess it's significant.  I've gotten in the
> habit of locking session variables EVERYWHERE because of the serious
> concerns pre-MX, but if this is having a negative impact on
> performance I'm not aware of I'd appreciate it if someone would let me
> know - thanks :)

Locking is a tough subject at first, but it is digestable.  We spend about
an hour on locking in our MX Master Class for good reason: there is a lot of
misinformation regarding what locking really is (it doesn't actually "lock"
ColdFusion resources at all), how locking applies to ColdFusion, how to
eliminate unintentional single-threading and collisions in your code (I
never see this discussed anywhere), how to optimize locking (also never seen
this discussed), and why 95% of all locking we've seen people perform in
their code is either ill-conceived or downright detrimental.

Considering locking only if it doesn't impact performance is like
considering safe sex only if you don't lose any feeling while wearing a
condom.  You do whatever is necessary to play safe, and then optimize the
mechanism to give you as much of what you want as possible.

Contact me offlist for a date and time when we can talk on the phone to
discuss this topic in more depth and with more interactivity than email
affords.  It won't be the whole shebang from class, but it will give you
some good understanding and get you started in the right direction.

Respectfully,

Adam Phillip Churvis
Member of Team Macromedia
http://www.ProductivityEnhancement.com

Download Plum and other cool development tools,
and get advanced intensive Master-level training:

* C# & ASP.NET for ColdFusion Developers
* ColdFusion MX Master Class
* Advanced Development with CFMX and SQL Server 2000


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205972
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to