简体   繁体   中英

How do .NET AppDomains keep the hosted process alive?

Say I have two AppDomains within a .NET/CLR process.

One of the AppDomains crashes due to a unhandled exception.

Would the other AppDomain still be running fine? What if the default AppDomain crashed otherwise?

I am just wondering on what keeps a process alive. Since AppDomains are completely seperate entities I assume the default AppDomain could crash and other AppDomains could continue?

Not even my C# book explicitly mentions what happens...

I'd assume that if any of the domains you have created from your main thread crash, you will be fine. However, if your "entry domain" crashes, the others die as well.

As you mentioned, AppDomains are completed separete. Each domain has its own resources so when it crash, others are untached. See this . If your default domain crashes all domains created from it will also failed I supposed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM