Re: Life of static variables in ASP.NET 2.0

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Dictionary description on MSND does say that iteration operations are not
thread safe.
Shimon.
"CS" <CS@xxxxxxxxxxx> wrote in message
news:%23Ln17PieGHA.3640@xxxxxxxxxxxxxxxxxxxxxxx

"Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23vnKcGieGHA.3888@xxxxxxxxxxxxxxxxxxxxxxx

that isn't necessarily a good thing.

Why ?

Static entities are not necessarily thread-safe. Be careful about when
you use them.


I say it is safe. Because it is "static". Static means "fixed", not
modifiable. Otherwise,
it is dynamic, which may not be safe. Static data only get changed when
ASP.net
recycles.

Example: Static data may be loaded in a singleton class. In this case,
whomever
references the variable 1st will load the class. The class will stay there
until Asp.Net recycles
and or web server service is restarted.

Comacho




.



Relevant Pages