473,791 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AppDomains and Threads Trying to create a robust, concurrentappli cation.

I would like to create an application where I have many concurrent
processes being managed by a monitoring process. Each process that is
"managed" will be invoked from an assembly dll (think reflection). I
want a way to invoke these processes in parallel utilizing multi-core
processors but I'd like to have the protection that AppDomains
provide.

I was doing some research where I found that there is no true
isolation between threads and AppDomains, Threads can cross over
AppDomains at the CLRs discretion.
(Reference:
http://en.csharp-online.net/Building...d_Relationship)
'Under the .NET platform, there is not a direct one-to-one
correspondence between application domains and threads. In fact, a
given AppDomain can have numerous threads executing within it at any
given time. Furthermore, a particular thread is not confined to a
single application domain during its lifetime. Threads are free to
cross application domain boundaries as the Win32 thread scheduler and
CLR see fit."

This quote concerns me since if I have processes that can crash within
a thread it's completely unpredictable which AppDomain goes down.
My major concern is do AppDomains allow for concurrent processes or
are they blocking? I ran a test application where I had 2 AppDomains
created in a console app and each wrote to the console. It ended up
that the first one blocked the other domain. I was wondering if that
was because the console can only handle one domain at a time or if
AppDomains themselves do not provide concurrency.

If it's the case where AppDomains by themselves do not provide
concurrency how is it possible to execute multiple process with
AppDomain protection and remoting capabilities?

Simple ASCII diagram of how the code should behave.

Monitor Process (Main AppDomain also a Windows Service)
|-Dispatches Lightweight processes that are isolated. (Monitor
Process can control these processes via remoting calls, remoting calls
back to the monitor process are not allowed)
|-Dispatched process of system monitoring and control. (The actual
brains of the monitor process but ran as a separate AppDomain to keep
the Monitor process lightweight and more resilent to crashes.) (2 way
remoting can occur here.
Aug 23 '08 #1
0 1868

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1923
by: Daylor | last post by:
hi. i have mult thread vb.net application. it has 30 threads. each thread serves 1 phone caller. the question : is there a reason , to create appdomain for each Phone Service ? meaning 30 appdomains ? or , the purpose for creating another appdomains, is diffrent ?
1
1457
by: Shaun McDonnell | last post by:
I have an application that uses the FileSystemWatcher to monitor for the "drop" of certain files in a folder. Custom actions are then executed based on the file name, size, etc. This application can listen for an unlimited number of files and therefore, runs an unlimitede number of threads that implement the FileSystemWatcher. However, if a critical error occurs one of these threads, the whole app crashes.
10
1518
by: cj | last post by:
I'm writing a TCP/IP server app that will have many simultaneous connections. The main thread listens for new connections and starts a thread to handle each requested connection. These are short lived threads that get a request and return a reply and end. Can the main thread tell me how many connection threads are currently running at any given time? I'd like to have a label on the main form to show how many connections the server is...
8
3787
by: Michael Bray | last post by:
I'm writing a library to provide plugin capability to my applications. It does this by loading DLL's into a new AppDomain for each plugin that is loaded. Now obviously when I write a plugin, I can make sure that my plugins don't throw any exceptions. But I certainly can't guarantee that other people writing plugins won't throw an exception. The problem is that if one of these other plugins throws an exception, it brings down the entire...
35
4044
by: Carl J. Van Arsdall | last post by:
Alright, based a on discussion on this mailing list, I've started to wonder, why use threads vs processes. So, If I have a system that has a large area of shared memory, which would be better? I've been leaning towards threads, I'm going to say why. Processes seem fairly expensive from my research so far. Each fork copies the entire contents of memory into the new process. There's also a more expensive context switch between...
1
2570
by: billr | last post by:
hi there, I hope that someone will be able to shed some light on little old confused me. We are developing an application which will be deployed onto a Terminal Server machine. The application will be used concurrently by multiple users. We have a static object (which as you well know is only static per AppDomain), -I think I've just figured out the answer to my question, but perhaps some confirmation wouldn't go amiss-
6
4131
by: Stephen Walch | last post by:
Our application environment consists of three basic layers: 1. Third-party unmanaged DLLs that were written before the CLR was invented and maintain a significant amount of information (including memory management and connection pooling constructs) as static variables which were intended to scoped to the process. 2. Managed C++ assemblies (.NET 1.1) that wrap the unmanaged DLLs as nice neat classes with managed interfaces.
8
1702
by: Fred Mertz | last post by:
I'm working towards an MCTS cert and I'm having to learn a bunch of stuff that I doubt I'd stumble across on my own. One such feature of .NET is AppDomains; programatically creating new AppDomains and programmatically loading/unloading assemblies in them. Question: What are some scenarios where I'd want to... 1 - programmatically create or destroy AppDomains 2 - load and unload assemblies in AppDomains?
3
3760
by: | last post by:
If this is simple, forgive my ignorance, but I'm coming from the CompactFramework where we don't use AppDomains. I did a fair bit of archive searching and couldn't find an answer and I got no responsed in the remoting group after a week, so I'm throwing a little wider net this time. I have a desktop app (FFx 2.0) developed with Studio 05 that loads assemblies in a separate AppDomains from the primary UI. I'd like to be able to hook up...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.