Groups | Blog | Home
all groups > dotnet clr > march 2006 >

dotnet clr : Using Appdomains on the client


John Grant
3/16/2006 5:48:05 PM
I was thinking of using appdomains and loading a winform assembly in each
one. This would be a client application. Creating an appdomain seams
lighter than a process and I can share data between appdomains. Any reason
why I shouldn’t? Any examples? I can create an appdomain and execute an
assembly in that domain on a seperate thread, but if an exception occurs I
don't know what domain that app was running in.


Pandurang Nayak
3/24/2006 11:45:26 AM
Nothing wrong. But depends on the situation. Remember that multiple
appdomains does not mean multiple processes - so the following applies:
- If an appdomain crashed the process, all other appdomains are crashed too
(no process-level isolation)
- Each appdomain that is created is still in the same process - and hence
from the perspective of the processor, still being considered as a single
process. This means that if you had too many appdomains, your execution might
take longer.

But sure, there are many advantages of creating an appdomain on-the-fly -
which is why I think it is there :)

Regards
Pandurang

--
blog: www.thinkingMS.com/pandurang


[quoted text, click to view]
Naveen
3/24/2006 4:56:47 PM


Do you have any particular requirement to load assemblies in different
appdomains?
Appdomains are primarily used to running partially trusted code or
unload assemblies (because assemblies cannot be unloaded so the
appdomain in which it is loaded is unloaded). If you have any of these
requirements then it may be a good choice to use appdomains. Keep in
mind appdomains are lightweight process and they also have additional
over heads.
AddThis Social Bookmark Button