Re: Need help in Global variable in c



Richard wrote:
There is a platform where different instances share the same
"globals" as demonstrated above?


Windows thread model.

Each thread under windows (I think is the same with pthreads)
sees all global variables from all threads.

To the OP : Multiple instances all have their own data unless some
platform specific sharing mechanism is used. The code above is process
private in the real world.

I would be seriously interested to hear of cases where is not the case
as I have never seen it before.


Other primitive platforms where there is no OS, can have a global
address space shared by all proceses.

MSDOS TSR's were one example, Macintosh applets were another,
and even if today those "OS"es are rare, they may still
exist somewhere.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
.



Relevant Pages