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



阅读更多
个人分类: asp.net)
上一篇install plugins, such as spring (STS), maven, tomcat, etc.
下一篇how-do-servlets-work-initialization-shared-variables-and-multithreading
想对作者说点什么? 我来说一句

webApp测试的区别

2017年11月01日 40KB 下载

Hybrid APP 与原生开发优缺点

2018年07月16日 32KB 下载

手机订餐APP源代码

2016年01月23日 3.02MB 下载

app-混合app-webapp区别

2018年01月24日 18KB 下载

Web App Development with Mongo

2017年11月27日 6.32MB 下载

没有更多推荐了,返回首页

关闭
关闭