multithreading - Static initializers and thread synchronization (.NET) -
Static interpreters are executed once before the first reference of the class. This means that once every single class can be reached, an investigation should be performed that stable initial actions are performed for the class.
It seems that multi-level environment with non-destructive static initialization can be a source of contention due to synchronization in classes when class is accessed through multiple threads.
My question is, what is the best way to reduce the effect of such underlying lock on class definitions introduced by static analytic?
The execution of a stationary constructor triggers the following event in an application domain:
- An example of a class is created.
- Any static members of the class are referenced
In order to handle concurrent issues, the responsibility of the class loader should be the constant constraint.
Comments
Post a Comment