Open Bug 901050 Opened 11 years ago Updated 2 years ago

Consider writing a mach_port_t IPC backend for OSX

Categories

(Core :: IPC, defect, P3)

x86
macOS
defect

Tracking

()

People

(Reporter: mattwoodrow, Unassigned)

References

(Depends on 1 open bug)

Details

When sharing IOSurfaces between processes (what we use for WebGL and plugins) we currently mark them as global, so that they can be looked up by ID number from any process in the system.

A better solution would be to use mach ports for our IPC code, because this supports proper ownership transfer/sharing, similar to passing file descriptors via POSIX sockets.

It appears that the chromium guys wrote a prototype for this, and abandoned it because OSX 10.5 didn't support a feature that they needed (EVFILTER_MACHPORT).

They also did seem in depth performance measurements, and found them to be faster than sockets. Their initial descriptor says that the wins are negligible, but the actual numbers show them to be 150% - 1000% faster than FIFO sockets for the packet sizes that they frequently see.

Details:

http://www.chromium.org/developers/design-documents/os-x-interprocess-communication

http://code.google.com/p/chromium/issues/detail?id=5308

The remaining issue I see is passing filedescriptors across processes. Comment 4 in the chromium bug has a solution, but it might be Lion (10.7) only.
As an update, SharedMemoryBasic_mach.mm has basically all the code we'd need for this, we just need to implement a ShareToProcess function for MacIOSurface using the same infrastructure.
Priority: -- → P3
Depends on: 1480205
See Also: → 1695866
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.