468,321 Members | 1,711 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,321 developers. It's quick & easy.

app domains and threads

I have some confusions about the two, is it possible to create threads
inside a particular domain and have other threads created in another
domain or do we create threads that will manipulate app domains?

i have read this in the .NET framework docs about domains and threads
and i need some clarifications on this:
There is not a one-to-one correlation between application domains and
threads. Several threads can be executing in a single application domain
at any given time and a particular thread is not confined to a single
application domain. That is, threads are free to cross application
domain boundaries; a new thread is not created for each application
domain.

At any given time, every thread is executing in one application domain.
The run time keeps track of which threads are running in which
application domains. You can locate the domain in which a thread is
executing at any time by calling the Thread.GetDomain method.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
1 2492
Paul,

See inline:

"Paul Fi" <na*******@hotmail.com> wrote in message
news:O$**************@TK2MSFTNGP12.phx.gbl...
I have some confusions about the two, is it possible to create threads
inside a particular domain and have other threads created in another
domain or do we create threads that will manipulate app domains?
App-domains are an abstraction that lie between threads and processes.
You can have multiple app domains in a process, and multiple threads running
in an app domain.

i have read this in the .NET framework docs about domains and threads
and i need some clarifications on this:
There is not a one-to-one correlation between application domains and
threads. Several threads can be executing in a single application domain
at any given time and a particular thread is not confined to a single
application domain. That is, threads are free to cross application
domain boundaries; a new thread is not created for each application
domain.
While a thread is not confined to a single application domain, for the
purposes of your code, you can assume that it is. While your code is
running, your thread will not be hijacked and moved to another application
domain. You can assume affinity with the current app domain from the point
that the app domain executed code on that thread.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

At any given time, every thread is executing in one application domain.
The run time keeps track of which threads are running in which
application domains. You can locate the domain in which a thread is
executing at any time by calling the Thread.GetDomain method.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by d.schulz81 | last post: by
6 posts views Thread by onetitfemme | last post: by
3 posts views Thread by Marc Eggenberger | last post: by
6 posts views Thread by Ludvig | last post: by
3 posts views Thread by Loki117 | last post: by
1 post views Thread by howard w | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.