.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

What is the difference between an application domain and a process?

Posted By :Muthu     Posted Date :November 02, 2010    Points :10   Category :.NET Framework 
An application domain is lighter than a process. Application domains are appropriate for scenarios that require isolation without the heavy cost associated with running an application within a process. A process runs exactly one application. In contrast, the CLR allows multiple applications to be run in a single process by loading them into separate application domains. Additionally, the CLR verifies that user code in an application domain is type safe.

You can also find related Interview Question to What is the difference between an application domain and a process?  below: 

What is Application Domain?

  
The primary purpose of the AppDomain is to isolate an application from other applications. Win32 processes provide isolation by having distinct memory address spaces. This is effective, but it is expensive and doesn't scale well. The .NET runtime enforces AppDomain isolation by keeping control over the use of memory - all memory in the AppDomain is managed by the .NET runtime, so the runtime can ensure that AppDomains do not access each other's memory.
Objects in different application domains communicate either by transporting copies of objects across application domain boundaries, or by using a proxy to exchange messages.
MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy. Objects that do not inherit from MarshalByRefObject are implicitly marshal by value. When a remote application references a marshal by value object, a copy of the object is passed across application domain boundaries. (More...)

What is an application domain?

  
An application domain (often AppDomain) is a virtual process that serves to isolate an application. All objects created within the same application scope (in other words, anywhere along the sequence of object activations beginning with the application entry point) are created within the same application domain. Multiple application domains can exist in a single operating system process, making them a lightweight means of application isolation.
An OS process provides isolation by having a distinct memory address space. While this is effective, it is also expensive, and does not scale to the numbers required for large web servers. The Common Language Runtime, on the other hand, enforces application isolation by managing the memory use of code running within the application domain. This ensures that it does not access memory outside the boundaries of the domain. It is important to note that only type-safe code can be managed in this way (the runtime cannot guarantee isolation when unsafe code is loaded in an application domain). (More...)

What is the difference between thread and process?

  
Thread - is used to execute more than one program at a time.
process - executes single program.
A thread is a path of execution that run on CPU, a process is a collection of threads that share the same virtual memory. A process has at least one thread of execution, and a thread always run in a process context. (More...)

Difference between thread and process?

  
Thread - is used to execute more than one program at a time.
process - executes single program (More...)

What is application domain?

  
It is a logical container that allow multiple assemblies to run in a single process. It provides isolation between applications. (More...)

What is the difference between Application caching and session objects?

  
Session A session is the time for which a particular user interacts with a web application. During a session the unique identity of the user is maintained internally. A session ends if there is a session timeout or user ends sessionby logging out.Sessions may change from user to user.

Cache Caching can be used to temporarily store page output or application data either on the client or on the server, which can then be re-used to satisfy subsequent requests and thus avoid the overhead of re-creating the same information.Caching is particularly suitable when you expect to Cache will be applicable to the entire application through out it's life cycle return the same information in the same format for many different requests.

Application Its nothing but similar to Session with a bit difference that is Session objects have scope within a particular session while application objects having scope within entire application. Application are accessible only from code running within the context of the originating application. Other applications running on the system cannot access or modify the values.
(More...)

what is application domain?

  
In application domains multiple application can run in the same process with out influencing each othere. If one of the application domains throws error it does not affect the other application domains. (More...)

How do I unload an application domain?

  
You should use the following static method in the System.AppDomain

class:
public static void Unload(AppDomain domain)

The Unload method gracefully shuts down the specified application domain. During shutdown no new threads are allowed to enter the application domain and all application domain specific data structures are freed. You cannot unload an application domain in a finalizer or destructor.
If the application domain has run code from a domain-neutral assembly, the domains copy of the statics and related CLR data structures are freed, but the code for the domain-neutral assembly remains until the process is shutdown. There is no mechanism to fully unload a domain-neutral assembly other than shutting down the process.
(More...)

What's difference between Web Application Project vs Web Site Project in Visual Studio

  
Web Site Project is deployed with source code to the server and all compilation takes place at runtime.

Web Application Projects, the code behind classes are compiled to dll. That dll is deployed and at runtime, the compiled code in the dll and the markup is combined to create a class which is used by the server to render output. (More...)

What is the difference between thread and process?

  
Thread - is used to execute more than one program at a time.
process - executes single program

Or

A thread is a path of execution that run on CPU, a proccess is a collection of threads that share the same virtual memory. A process have at least one thread of execution, and a thread always run in a process context. (More...)

Difference between Cache object and application object ?

  
Difference between the Cache and Application objects is that the Cache object provides cache-specific features, such as dependencies and expiration policies. (More...)

Difference between thread and process?

  
--Thread is a path of execution that run on CPU, a process is a collection of threads that share the same virtual memory.

--A process has at least one thread of execution, and a thread always run in a process context. (More...)

What is the difference between thread and process?

  
A thread is a path of execution that run on CPU.

A process is a collection of threads that
share the same virtual memory.

A process has at least one thread of execution, and a
thread always run in a process context. (More...)

Explain the difference between cache object and application object.

  
Application Object: Application variable/object stores an Object with a scope of availability of the entire Application unless explicitly destroyed.

Caching Object: The lifetime of cache is throughout the lifetime of an application or is based upon timeouts (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend