3 ms·
Correct, normal globals no. There is a way to make some special values have this behavior though. It's been a long time, but I think the reason was to have some
by ctstover 11y ago
Correct, normal globals no. There is a way to make some special values have this behavior though. It's been a long time, but I think the reason was to have some analog to the win16 behavior. In that shared-everything universe, there were these IPC through dll patterns.
- kazinator 11y agoWin32 has an API for shared memory that is straightforward to use. You use CreateFileMapping with an INVALID_HANDLE for the file to create a mapping which is like MAP_ANONYMOUS in mmap (not backed by a file). It is not literally anonymous because you can give the mapping a name (similar to, say, a POSIX semaphore name in sem_open). Other processes can attach to the mapping using the name. To actually instantiate the mapping in the address space, you use the MapViewOfFile function. MSDN: https://msdn.microsoft.com/en-us/library/windows/desktop/aa366551%28v=vs.85%29.aspx https://msdn.microsoft.com/en-us/library/windows/desktop/aa3... Been years since I used this stuff.