September 2007
Intermediate to advanced
600 pages
20h 21m
English
You’ve seen why locks are sometimes needed to avoid race conditions. You’ve seen the simplest way to implement them—with Exclusive locks. You’ve seen how to avoid potential bottlenecks by using a mix of Exclusive and ReadOnly locks. Hopefully, you’ve noticed a pattern emerging: If you’re worried about race conditions, your goal should be to protect your data with <cflock>, but to do so in the least obtrusive way possible. That is, you want your code to be “smart” about when page requests wait for each other.
So far, all of the <cflock> tags in this chapter have been scoped locks. Each has used a scope="Application" attribute to say, “This lock should block or be blocked by all other locks in the application.” ...
Read now
Unlock full access