See this[1] document for details on how that's done.
Pretty much as I expected, eg connections are directories with the parent directory being the protocol, and there's separate files for control messages and the data. Control files are read and written in ASCII to avoid endian issues.
How would you expose something like OpenGL though? I mean, would you serialize the individual GL calls into a custom RPC and feed it to a "gpu/0/opengl/data" file? Exposing the GL calls as separate files could work I guess, if there's guarantees that writes to separate files maintain order (can't seem to find any clear discussion on this right now), but given the number of calls available that seems like it might generate a lot of overhead.
See this[1] document for details on how that's done.
Pretty much as I expected, eg connections are directories with the parent directory being the protocol, and there's separate files for control messages and the data. Control files are read and written in ASCII to avoid endian issues.
How would you expose something like OpenGL though? I mean, would you serialize the individual GL calls into a custom RPC and feed it to a "gpu/0/opengl/data" file? Exposing the GL calls as separate files could work I guess, if there's guarantees that writes to separate files maintain order (can't seem to find any clear discussion on this right now), but given the number of calls available that seems like it might generate a lot of overhead.
[1]: https://plan9.io/sys/doc/net/net.pdf