SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Implement IPC API and Posix implementation

Open TheMadman opened this issue 1 month ago • 3 comments

Description

Implements an opaque IPC type with APIs for processes to create the IPC channel, as well as retrieval functions on both ends.

Also implements the POSIX part using a Unix stream socket.

Existing Issue(s)

https://github.com/libsdl-org/SDL/issues/14506

TheMadman avatar Nov 24 '25 10:11 TheMadman

Sorry for the pipeline noise, I'll try to get it working on my own remote prior to opening a PR next time.

TheMadman avatar Nov 24 '25 15:11 TheMadman

I'm unclear how this is intended to be used. It seems like it sets up a hard coded file descriptor 3 which the child can use for reading from the parent, but how is that different/better than just using stdin?

As it is, it's not portable to non-POSIX applications, so this should be fleshed out and have a working Windows implementation before being merged, if we decide this is an approach we want.

slouken avatar Nov 24 '25 16:11 slouken

I'm unclear how this is intended to be used. It seems like it sets up a hard coded file descriptor 3 which the child can use for reading from the parent, but how is that different/better than just using stdin?

As it is, it's not portable to non-POSIX applications, so this should be fleshed out and have a working Windows implementation before being merged, if we decide this is an approach we want.

I want these IPCs to be used to send shared memory/GPU resources between applications, so that multiple processes can read/write texture data from the same source without lots of copying. On Linux/BSDs, that means sending file descriptors as ancillary data on Unix sockets, similar to how Wayland protocol manages it.

Since Windows creates these resources at given paths in one process, and attempts to open those paths in a different process, the IPC (and especially the whole communications protocol) is likely to be different.

TheMadman avatar Nov 24 '25 17:11 TheMadman