Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Setting up the TLB and handling the page faults,

Should be done once, at the beginning, and the segment re-used.

> then doing the interprocess synchronization

There is IPC anyway when you are sending information between processes. If you delve into the kernel you may be surprised at the number of layers of operations it takes to present data from one process to another using a socket.

> but the constant and synchronisation overhead for a write() is smaller than an mmap()

You're assuming the pages needed are already mapped in the former case. If you're writing anything of size, the pages will probably need to be faulted in anyway. If you're writing something small, then setting up your shared memory at the beginning and then re-using that memory is obviously the way to go, rather than getting and destroying shared memory segments every time you need them.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: