-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple recommends against direct use of Mach #309
Comments
@jdm @mrobinson @sagudev I'd be interested in your thoughts about the wisdom of switching to Unix domain sockets for macOS. Possible advantages:
Possible disadvantage:
Unknowns:
|
I think it would be an unacceptable trade off to accept a performance degradation in order to stop using mach ports. Despite the recommendation listed above, mach ports are used by all browser engines and are also an effective way to send IOSurfaces across process boundaries -- something we will likely need for Servo in the future. |
I see. If I interpret the rest of the comment correctly, it sounds like you may not be in favour of switching from Mach ports to Unix domain sockets even if sockets performed the same or better than Mach ports. Right?
That's an interesting data point, thanks. Good to know there's a precedent. Also, Webkit IPC has some similar code to the macOS support in this repository, so that's useful for comparison.
It seems IOSurfaces are Apple-specific, so would it make sense to pass IOSurfaces between processes via ipc-channel rather than using Mach ports directly? (I'm wondering whether the platform abstraction will ultimately belong higher up, above IOSurfaces.) |
If there was a performance benefit to using Unix domain sockets on macOS, I think that would be a different conversation. These are all sort of hypothetical scenarios though. I think seeing actual numbers are pretty important for making these kind of decisions.
It's unclear whether we'd pass IOSurfaces via |
Agreed. I was just trying to get to the rationale for Mach ports.
Did you mean "or mach ports directly in Servo"? If that direction was chosen, then there wouldn't appear to be any IOSurfaces requirements for ipc-channel. |
I tried a quick spike of using UNIX sockets instead of Mach ports, but there are some basic missing features that would take some effort to replicate. Apart from
The tests big_data* fail with errno 54 (ERRCONNRESET) on a send. It appears that the receiver closes the connection before all the sent data was received. I presume this is related to item 2 above. If anyone else is motivated to continue the spike, please do, but failing that, I suggest we close this issue. Footnotes
|
While trying to understand the security implications of using Mach message ports, I found the following in this Apple documentation page:
So I wonder if it would be better to use Unix domain sockets instead.
The text was updated successfully, but these errors were encountered: