basic architecture question

  • Thread starter Thread starter RSH
  • Start date Start date
R

RSH

Hi,

I have a question regarding multiple instances of an application running on
a single machine.

If I have two remote users (using Citrix or Netilla) launching two seperate
instances of an application, are my static classes shared between the
seperate instances?

Thanks!
Ron
 
Hi,

I have a question regarding multiple instances of an application running on
a single machine.

If I have two remote users (using Citrix or Netilla) launching two seperate
instances of an application, are my static classes shared between the
seperate instances?

Thanks!
Ron

Hi Ron,

Do you mean static fields? (Static classes are those that can not be
instantiated). Static fields are shared only in one Application
Domain. So if you have two application, there will be separate
instances.

HTH,
Sergey
 
RSH said:
Hi,

I have a question regarding multiple instances of an application running on
a single machine.

If I have two remote users (using Citrix or Netilla) launching two seperate
instances of an application, are my static classes shared between the
seperate instances?

Separate instances will run in different processes and therefore get their
own static instances.

Even applications that go out of their way to map global memory that they
want to share with other apps would have to specifically request that the
memory be global across sessions other wise only process with in the session
would see the memory.
 
RSH said:
Hi,

I have a question regarding multiple instances of an application running
on a single machine.

If I have two remote users (using Citrix or Netilla) launching two
seperate instances of an application, are my static classes shared between
the seperate instances?

Thanks!
Ron

Separate applications run in separate processes, data is not shared across
processes.
Managed code is not shared unless the assembly is NGen'd.

Willy.
 
Ron,

To elaborate on other answers, yes, separate processes will have
separate values for your static members, but the process boundary is not the
boundary for static variables. Static variables are scoped at the app
domain level (which Sergey pointed out) and for the most part, most
applications have just one application domain.

However, processes can have multiple application domains, so you can
have multiple values per process (but that's if you are in a process that is
spawning multiple app domains, which you probably are not doing, at least
willingly).
 
Back
Top