How does Chrome share data between its processes?
I also would like to apply the same technique to my app, but I don't know how Chrome shares data(of the c开发者_JAVA技巧urrent tab) to the main process(user interface). How would that be possible? How they do it?
According to this design document, Chrome uses named pipes as its IPC transport mechanism on Windows platforms, and socket pairs under Linux and OS X.
There are multiple ways processes can communicate with each other:
http://msdn.microsoft.com/en-us/library/aa365574(VS.85).aspx
The Apache webserver uses a Scoreboard file to coordinate between the master and slave processes.
It initially tries to use a shared memory segment (such as from shm_open(2)
), followed by mmap(2)
of a plain file. Either approach works well. I imagine Apache forces all accesses to its scoreboard via semaphores (sem_open(2)
), but if the updates are atomic single-writes, it may not need to.
精彩评论