views:

287

answers:

4

We know that a single application instance can use multiple cores and even multiple physical processors. With cloud and cluster computing, or other special scenario, I don't know if a single stance can run across multiple computers, or across multiple OS instances.

This is important for me because, besides being considered as bad programming, I use some static (as in C#) (global) variables, and my program will probably have an unexpected behavior if those variables become shared between computers.

Update I'll be more specific: I'm writing a .NET application, that has one variable that counts the number of active IP connections, to prevent that the number of connections don't exceed a limit per computer. I am concerned if I deploy that application in a cloud-computing host, if I'll have one instance of the variable per computer.

+1  A: 

If you can't even imagine a situation where this happens, why are you worrying about it?

Usually, this could happen in a scenario involving RPC of some kind.

shoosh
I'm worried because perhaps my application, as it is, couldn't be deployed in a cloud server, as an example.
Jader Dias
+2  A: 

If you want to learn how to realize such a scenario (a single instance across multiple computers), I think you should read some articles about MPI.

it has become a de facto standard for communication among processes that model a parallel program running on a distributed memory system.

Regarding your worries: Obviously, you'll need to somehow consciously change your program to run as one instance across several computers. Otherwise, no sharing of course takes place, and as Shy writes, there is nothing to worry about. This kind of stuff wouldn't happen automatically.

Pukku
+2  A: 

What programming environment (language) are you using? It should define exactly what "static" means. Most likely it does not allow any sharing of information between different computers except through explicit channels such as MPI or RPC.

However, abstracted high-level environments may be designed to hide the concept of "running on multiple computers" from you entirely. It is conceivable to design a virtual machine that can run on a cluster and will actually share static variables between different physical machines - but in this case your program is running on the single virtual machine, and whether that runs on one or more physical machines should not make any difference.

Michael Borgwardt
My favorite language is C#.
Jader Dias
A: 

Well yes, there's distcc. It's the GCC compiler distributed.

Ubersoldat