• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Using <CFLOCK>

The earlier section “The Session Scope” mentioned that it’s a good idea to lock shared memory scope variables. In this section, we will look at just what this means, why it should be done, and how we go about doing it.

As previously mentioned, shared memory variables—namely those in the Session, Application, and Server scopes—live in memory on the server. They are called shared memory scope variables because several pages can, and usually do, share access to these variables at the same time. For example, we might have several user templates trying to read or set the value of an Application scope variable all at the same time. Because ColdFusion Server uses multithreading (the capability to respond to multiple requests at one time) to handle user requests (which is usually a good thing), ColdFusion Server is quite happy to let this happen.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint