Re: Need help in Global variable in c
- From: Richard <rgrdev@xxxxxxxxx>
- Date: Sun, 30 Sep 2007 19:57:29 +0200
jacob navia <jacob@xxxxxxxxxx> writes:
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.
That is not the same as multiple instances. Not by a long shot. Or?
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.
Hmm. Yes. Well. Possibly I was wrong to thing we were talking multiple
instances on a modern multi tasking OS where the chance of different
*instances* of user applications sharing global datam as defined
earlier, is highly unlikely.
.
- References:
- Need help in Global variable in c
- From: yinglcs@xxxxxxxxx
- Re: Need help in Global variable in c
- From: Mike Wahler
- Re: Need help in Global variable in c
- From: Richard
- Re: Need help in Global variable in c
- From: jacob navia
- Need help in Global variable in c
- Prev by Date: Re: typedef with function pointers
- Next by Date: Re: Macro for supplying memset with an unsigned char
- Previous by thread: Re: Need help in Global variable in c
- Next by thread: Re: Need help in Global variable in c
- Index(es):