به کارگیری مفهوم Double-checked locking
200, OK
https://pseudomuto.com/2012/02/efficient-thread-safe-caching-with-asp.net/ icon

ضرورت استفاده به هنگام Caching، خصوصا اگر تعداد خوانش بالا و همزمان روی دیتای کش شده باشد و از طرفی Reload دیتا زمانبر.

if (exists in cache)
{
   return from cache
}
lock(staticObject)
{
   if (exists in cache)
   {
       return from cache
   }
   read from db & cache & return
}


به کارگیری مفهوم Double-checked locking