What is the life expectancy of static hashtable

X

xzzy

Using ASP.net, C# and a static class, does the following from MSDN mean:

1. a static hashtable would only live during the session and end when the
session ends

2. there would be a different static hashtable for each session


++ from MSDN ++

Static Variables - Lifetime

Extension of Lifetime
If a local variable is declared with the Static keyword, its lifetime is
longer than the execution time of the procedure in which it is declared. If
the procedure is inside a module, the static variable survives as long as
your application continues running.

If a static variable is declared in a procedure inside a class, the
variable's lifetime depends on whether the procedure is shared. If the
procedure is declared with the Shared keyword, the variable's lifetime
continues until your application terminates. If the procedure is nonshared,
its static variables are instance members of the class, and their lifetimes
are the same as that of the class instance.


++ end ++


Thank you,

John
 
E

Eliyahu Goldin

No. There will be one static hashtable across all sessions until the
application terminates.

Eliyahu
 
K

Kevin Spencer

And remember, this is in dog years.

--
;-),

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top