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

Incidentally you can use the exact same setup (plush mmap) for interprocess queues.

The advantage of threads is that you can pass pointers to your data through the queue, while that's harder to do between processes and you have to resort to copying data in the queue instead.



>while that's harder to do between processes and you have to resort to copying data in the queue instead.

I could be wrong - I've never done it, but I understood that you can even store POSIX mutexes and condition vars in shared mem so that 2 processes (or more?) can process data without copying, so long as they use the both use the same locks stored in the shared memory.


Yes, when the mutex or condvar is inited with attribute PTHREAD_PROCESS_SHARED.




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

Search: