[quoted text, click to view] "Stelrad Doulton" <___@____.com> wrote in message
news:OfGm8IzcFHA.2124@TK2MSFTNGP14.phx.gbl...
> What I want to know is; do all shell executed .NET app run in the same
> process?
No, each application will exist in it's own process.
[quoted text, click to view] > For that matter do all runtime-hosts run all of their app-domains
> in the same process?
Yes, the app-domains created for an application will all exist in that
application's process.
[quoted text, click to view] > In the case of a shell executed application here's my understanding:
> Double
> clicking a .NET executable file invokes a runtime host specifically for
> running user space apps (by which I mean services, exe's etc - not hosted
> by
> IIS, SQL Server or anything else).
Not entirely. Running a .NET EXE loads a startup shim which then creates a
runtime host for that application. There isn't one overall runtime host, but
one for each app.
[quoted text, click to view] > This runtime-host creates an app domain, loads the application's primary
> assembly and kicks it off at the entry point. Referenced assemblies are
> loaded at the point at which they are first needed. So is this runtime
> host
> an ever present process on my machine? Is there a limit to the number of
> add
> domains it can support in one process?
The runtime hosts are present for the duration of your .NET application. As
for the number of app-domains in a process, I have no idea.
[quoted text, click to view] > Here's another thing, I also read:
>
> "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"
>
> OK
>
> "and a particular thread is not confined to a single application domain. "
>
> eh?
>
> "That is, threads are free to cross application domain boundaries; a new
> thread is not created for each application domain."
>
> So is the run-time host playing scheduler for a predefined number of
> threads
> switching them between app domains?
Not really. If you kick off a synchronous operation to another app-domain
merely means that your thread enters that new app-domain. When it completes
there it will return to the originating app-domain. Think of a method call
where the caller and callee are in different app-domains. There is only one
thread, but two app-domains. That said, the most common means of
communicating between app-domains involve Remoting, and this muddies the
waters a little, since the caller's thread is suspended, whilst the callee
executes on a ThreadPool thread.
Also, the ThreadPool threads themselves are shared amongst all the
app-domains.
[quoted text, click to view] > Thanks to anyone who can shed some light