views:

330

answers:

2

The project that i am right now handling is based on Interprocess Communication.

And am using Shared memory concept for this interprocess communication.

There are few files tat i need when i use shared memory concept for example sys/ipc.h, sys/shm.h

Are these files a part of visual studio insatallation or it is something that i hav to download.

I need to know if i need to reinstall visual studio 2005 and enable interprocess comunication so tat these files are automatically in hand for use.

check this link http://www.cs.cf.ac.uk/Dave/C/node27.html

If this about link referes to Solaris which concept can i use to share memory in windows

EDIT: But CreateFileMapping is to map files right.I need to map a memory location to another process so as to use the data stored in that location..

Thank you i will try the code..

A: 

The header files you mention are for UNIX-like systems. Downloading the headers would do you no good, as UNIX and Windows use different approaches to shared memory and IPC in general. See the CreateFileMapping and related functions for more info.

Edit: The link you quote refers explicitly to Solaris, not Windows. As I have already said, if you want to use shared memory on Windows you need to use the memory mapped file functions like CreateFileMapping. In outline, both processes need to create a file mapping and can then treat the mapped file as shared memory. There is an example here.

anon
no i think these files are used in windows as well.
hey thanks m trying out that code..
@neha: Completely wrong. The POSIX and Win32 APIs are different in just about every aspect, other than being "shared memory".
Richard
uh so which one do i use for sharing memory data between 2 processes which do not have their memory shared in window
A: 

http://msdn.microsoft.com/en-us/library/aa366551(VS.85).aspx

Use CreateFileMapping and MapViewOfFile.

Sanjaya R