GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Microsoft  >  ASP.NET 2.0

 Print  |  
Question:  Application Object

Answer: What methods must be used with the application object to ensure that only one process access a varaible at a time?


October 10, 2008 12:12:36 #2
 Anandbprem   Member Since: October 2007    Total Comments: 2 

RE: Application Object
 

The HttpApplicationState class provides two methods, Lock and Unlock, that allow only one thread at a time to access application-state variables.

Calling Lock on the Application object causes ASP.NET to block attempts by code running on other worker threads to access anything in application state. These threads are unblocked only when the thread that called Lock calls the corresponding Unlock method on the Application object.

     

 

Back To Question