In classic ASP there is a global object called ‘Application’ that is accessed simultaniously by all sessions.
As the ‘Application’ object is a shared resource, can it cause dead locks?
EDIT: If not, why does it has lock and unlock methods for? Reference
Deadlock is different from normal blocking. Since pages are processed in different threads, if you want to prevent another request from modifying that shared resource, you use Lock, and to allow modification again, you use the Unlock method. The thing is, if you don’t use those methods, another request can change the value of an item in the application state, while you’re relying on an old value. Or two requests can try to modify it simultaneously and it might cause problems. Lock method causes a request to wait until the other request unlocks application; after that, it can continue.
Deadlock is a situation in which thread A locks resource 1 and waits for resource 2 to become available. At the same time thread B, which has locked resource 2 needs to access resource 1 (which is locked by thread A) to continue to work and be able to release the resource afterwards. In this situation, none of the threads can continue (one of them has to be terminated to allow continuation). This is a deadlock. Application.Lock will not cause deadlocks on its own if correctly used. But if it’s not used correctly, it might cause deadlocks (when coupled with another shared resource that needs locking and deadlocks are not taken care of).