Are static variables stored on the stack itself similar to globals? If so, how are they protected to allow for only local class access?
In a multi
Are static variables stored on the stack itself similar to globals? If so, how are they protected to allow for only local class access?
No, static refers to storage duration only -- they may be global or have local scope. Globals have static storage.
In a multi threaded context, is the fear that this memory can be directly accessed by other threads/ kernel? or why cant we use static/global in multi process/ thread enviornment?
Multiple writers will introduce ambiguity. You need to protect shared resources using a mutex or some such locking mechanism.