473,804 Members | 3,383 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 1871

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

Similar topics

1
1925
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
1458
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
1520
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
4049
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
1703
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
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10564
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
10320
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
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9134
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7609
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
6846
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
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2981
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.