I' using shared memory (with semaphore) for communicating between two processes: Fist, I open shared memory object using the call:
int fd = shm_open("name") [http://linux.die.net/man/3/shm_open]
Second, I map this shared mem object into my adress space using call:
void* ptr = mmap(..fd..) [http://linux.die.net/man/2/mmap2]
However, I want to use EPOLL in conjunction with shared memory file descriptor==> I don't use mmap anymore, and instead, using EPOLL for monitoring, and then add, write function for direct access to shared memory using fd (shared memmory file descriptor)
My question is that: how is the speed of direct reading and writing on shared memory object in comparison with memcpy on pointer returned by mmap?
read(fd, buffer) vs memcpy(des, source, size) //???
Hope to see your answer! Thanks!