Horje
lock a cache in asp.net Code Example
lock a cache in asp.net
private static object ThisLock = new object();

public string GetFoo()
{

  // try to pull from cache here

  lock (ThisLock)
  {
    // cache was empty before we got the lock, check again inside the lock

    // cache is still empty, so retreive the value here

    // store the value in the cache here
  }

  // return the cached value here

}




Csharp

Related
get path revit linked unload Code Example get path revit linked unload Code Example
c# get Full Exception message if InnerException is not NULL Code Example c# get Full Exception message if InnerException is not NULL Code Example
c# logical operators Code Example c# logical operators Code Example
c# ilogger for inherited class Code Example c# ilogger for inherited class Code Example
how to read reportview query string asp.net c# Code Example how to read reportview query string asp.net c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9