static variable in web app, .net app domain, worker process and app pool

after reading many articles, I got the conclusion:

one .net web app per .net app domain

one worker process can have multiple app domains.

one app pool can have multiple worker processes


so questions are coming:

what is static variable lifecycle?


static variable belongs to its own app domain. (.net)

Note: there is an 例外:

http://odetocode.com/Articles/305.aspx

Note again: the one caveat to the idea of an AppDomain as a boundary is that ASP.NET applications will run with full trust by default. Fully trusted code can execute native code, and native code can essentially have access to anything inside the process. You’ll need to run applications with partial trust to restrict access to unmanged code and verify all managed code to secure AppDomains.

这里需要注意:AppDomain是.net的一个概念,当运行Native code, 这是规则就变了,对于native code, app domain是透明的,这是Native code眼里只有process这个边界了。


那么app domain,或者这些跨边界的访问数据用什么技术:这是就需要Web service, .net remoting等技术的(我想到的就是序列化了)

参考文献:

http://odetocode.com/Articles/305.aspx 

http://stackoverflow.com/questions/17390248/scope-of-static-variables-in-asp-net-sites 

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/67e39bd8-317e-4cf6-b675-6431d4425248.mspx?mfr=true

http://blogs.msdn.com/b/carmelop/archive/2013/03/22/how-many-web-applications-per-application-pool.aspx




你可能感兴趣的:(static variable in web app, .net app domain, worker process and app pool)