Relative Content

Tag Archive for c#asp.netlocking

Why is the lock not working for a static variable in ASP.NET?

The function GetYYY() is called from an ASP.NET base page. So it can happen at the same time for several users. _data is something which should be initialized only once. However, the lock does not lock the static list. From our log, the log.Debug is executed twice and 2 values are logged (see the comment below). Why does the lock not work?

Why is the lock not working for a static variable in ASP.NET?

The function GetYYY() is called from an ASP.NET base page. So it can happen at the same time for several users. _data is something which should be initialized only once. However, the lock does not lock the static list. From our log, the log.Debug is executed twice and 2 values are logged (see the comment below). Why does the lock not work?

Why is the lock not working for a static variable in ASP.NET?

The function GetYYY() is called from an ASP.NET base page. So it can happen at the same time for several users. _data is something which should be initialized only once. However, the lock does not lock the static list. From our log, the log.Debug is executed twice and 2 values are logged (see the comment below). Why does the lock not work?