AppDomain vs Process

W

wycklk

According to Microsoft, threads can execute across
AppDomains without the overhead associated with inter-
process communication and process context switch (vs
thread context switch).

I did an experiment to verify the above. However, I found
there is no obvious performance gain when I use 2
AppDomains within one process vs 2 separate process.

Anybody can share his experience ?
 
R

Rob Teixeira [MVP]

It honestly depends what you are doing. If the two app domains are
communicating heavily between each other (for example, using methods of
objects housed seperately in each app domain), then yes, two app domains are
faster as they don't have the overhead of the communication layer required
for two processes.
Also, processes take up far more resources than app domains, which are
fairly light-weight in comparison.

However, in my opinion, the app domain's biggest boon is not performance,
but the ability to create isolation within a process. Isolating data that
shouldn't interact without checks and regulations, having the ability to
bring app domains up and tear them down without affecting other app domains
within the process. IIS is a fairly good model of this kind of behavior,
where you can isolate web applications from each other.

-Rob [MVP]
 

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

Top