473,507 Members | 8,054 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Threads and AppDomain


Hello all!

Im 'trying' to make a plugin-based application (system) - everything except
the main window are plugins (all other sub-windows, panels, etc).

Each plugin comes from dll's.. and each dll is loaded on a separate
AppDomain..
my question:
Does creating a new AppDomain, automatically start a new thread?

Does this mean, that each of my plugin runs on their own thread? -which is
really my intention. Is this approach even a good one?

<im new to dotnet/appdomains, but is familiar with threading concepts..
this one is just confusing for me>

thanks for any help.

--
It is only through the heart that one can see rightly. (The Little Prince)

MickeyMicks
Oct 20 '06 #1
5 6698
No, creating a new application domain doesn't automatically create a
new thread. however you can create and execute one or more threads
within a new AppDomain if you need to.

More info here:
http://msdn2.microsoft.com/en-us/library/a60kkx8k.aspx

--
Chris Fulstow
MCP, MCTS
http://chrisfulstow.blogspot.com/
mickeymicks wrote:
Hello all!

Im 'trying' to make a plugin-based application (system) - everything except
the main window are plugins (all other sub-windows, panels, etc).

Each plugin comes from dll's.. and each dll is loaded on a separate
AppDomain..
my question:
Does creating a new AppDomain, automatically start a new thread?

Does this mean, that each of my plugin runs on their own thread? -which is
really my intention. Is this approach even a good one?

<im new to dotnet/appdomains, but is familiar with threading concepts..
this one is just confusing for me>

thanks for any help.

--
It is only through the heart that one can see rightly. (The Little Prince)

MickeyMicks
Oct 20 '06 #2
Ah well you have a choice - I would PING Nicholas Paldino or Jon Skeet, both
C#/NET MVP's, well versed in the subject and lurk here often. To be honest,
the groups are well tended by many experts in .NET so you could ask your
questions here anyway and see what answers came back.
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"mickeymicks" <mi*********@discussions.microsoft.comwrote in message
news:5B**********************************@microsof t.com...
>
Hello all!

Im 'trying' to make a plugin-based application (system) - everything
except
the main window are plugins (all other sub-windows, panels, etc).

Each plugin comes from dll's.. and each dll is loaded on a separate
AppDomain..
my question:
Does creating a new AppDomain, automatically start a new thread?

Does this mean, that each of my plugin runs on their own thread? -which is
really my intention. Is this approach even a good one?

<im new to dotnet/appdomains, but is familiar with threading concepts..
this one is just confusing for me>

thanks for any help.

--
It is only through the heart that one can see rightly. (The Little Prince)

MickeyMicks

Oct 21 '06 #3
mickeymicks <mi*********@discussions.microsoft.comwrote:
Im 'trying' to make a plugin-based application (system) - everything except
the main window are plugins (all other sub-windows, panels, etc).

Each plugin comes from dll's.. and each dll is loaded on a separate
AppDomain..
my question:
Does creating a new AppDomain, automatically start a new thread?
No.
Does this mean, that each of my plugin runs on their own thread? -which is
really my intention. Is this approach even a good one?
Well, running each plugin in a different AppDomain has its advantages,
although it makes life slightly trickier in terms of passing objects
around between plugins and the main application.

If you want to run each plugin in a different thread (and without
knowing the details of what the plugins do, it's hard to say whether or
not that's a good idea) you'll need to start the extra threads
yourself.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 22 '06 #4
hmmmmm........I'm sure I posted this in response to a different
question.....how odd!!!

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"John Timney (MVP)" <x_****@timney.eclipse.co.ukwrote in message
news:hu******************************@eclipse.net. uk...
Ah well you have a choice - I would PING Nicholas Paldino or Jon Skeet,
both C#/NET MVP's, well versed in the subject and lurk here often. To be
honest, the groups are well tended by many experts in .NET so you could
ask your questions here anyway and see what answers came back.
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"mickeymicks" <mi*********@discussions.microsoft.comwrote in message
news:5B**********************************@microsof t.com...
>>
Hello all!

Im 'trying' to make a plugin-based application (system) - everything
except
the main window are plugins (all other sub-windows, panels, etc).

Each plugin comes from dll's.. and each dll is loaded on a separate
AppDomain..
my question:
Does creating a new AppDomain, automatically start a new thread?

Does this mean, that each of my plugin runs on their own thread? -which
is
really my intention. Is this approach even a good one?

<im new to dotnet/appdomains, but is familiar with threading concepts..
this one is just confusing for me>

thanks for any help.

--
It is only through the heart that one can see rightly. (The Little
Prince)

MickeyMicks


Oct 23 '06 #5
hello all!
Does creating a new AppDomain, automatically start a new thread?
No.
now, im thinking of allowing a plugin to run on its own thread and/or its
own domain (w/c basically complicates my life more).
Well, running each plugin in a different AppDomain has its advantages,
yeah, kinda considered appdomains, for isolation of the plugins. because in
the type of plugins i have, there's a big chance that one plugin might hang
or breakdown.. and thru appdomains i could prevent the rest of the plugins
(the ones that are still ok) from joining in the 'headache'. right?
>If you want to run each plugin in a different thread (and without
knowing the details of what the plugins do...
that's basically it: my host program (main window and all) will load some
plugins. and thru a plugin interface it only knows two functions - Start()
and Stop(). my host program doesnt know what the plugins do, it just calls
the start and stop functions.

Normally, the Start() function in a plugin, contains showing of a window.
So, in a non-'multithreaded' system, i would just invoke the Start for each
plugin. On the other hand, for multithreaded system, i would be invoking the
Start() inside a new thread. Sounds really, simple.. but is this correct?
What are the things that i should worry about? - i.e. about the marshalling
of data, im still researching about it.

also in my plugin system, i have an "event engine" wherein plugins can:
register new events, subscribe to a registered event, and trigger a
registered event. this event engine will be my communications for
host-plugins and plugin-to-plugins. since, the plugins might be on a separate
thread or domain, i know i need to worry about marshalling again (for the
event arguments). Could you give me some idea on how to go about this, or at
least a good reference, particularly about events across multple threads?
Please :)

thanks for the replies! ..i really appreciate it.

--
It is only through the heart that one can see rightly. (The Little Prince)
MickeyMicks
Oct 30 '06 #6

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

Similar topics

10
8542
by: Cool Guy | last post by:
Consider: void Start() { if (!TryToDoSomething()) ShowErrorMessage(); }
0
1464
by: Benny | last post by:
Hi, My application creates a number of aync threads....i want to make sure that all these threads are of the invariant culture. So, how do i ensure that whenever a new thread is created in my...
2
2312
by: Brett | last post by:
What are the advantages/disadvantages of using one process with multiple threads or doing the same task with multiple processes, each having one thread? I see using multiple threads under one...
2
1310
by: mmitchell | last post by:
I have a service that executes a method in a dll. This method spawns several threads. When I stop the service I notice the process doesn't stop right away. I assume the threads that some time to...
3
7290
by: Mike Binks | last post by:
I wish to make sure all unhandled exceptions (UE) are handled by a central handler. For primary thread UEs, this may be done by string exceptionText; ...
3
1384
by: michdoh | last post by:
Hi All I'm looking for some help on creating a basic multi threaded application. i'n new to threads in this environment so for test purposes I've produced a very basic program. (which doesn't...
0
1190
by: Mike Schilling | last post by:
Is there any way to list all the threads currently running for an AppDomain, or even for a process? That is, having caught a CannotUnloadAppDomainException telling you that some threads are...
20
541
by: greg.johnsen80 | last post by:
I have been struggling with the following problem: In my console application I have function1 calling function2 which in turn uses threads to do computationally intensive tasks. Some of the...
0
1843
by: jeremyje | last post by:
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...
0
7223
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,...
0
7314
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,...
0
7372
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...
1
7030
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...
1
5041
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...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
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 ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.