randy@erik.UUCP (Randy Brown) (10/02/90)
I have seen assertions in this group that the shared-memory extension allows for client-server sharing of pixmaps. In our image processing applications this would be EXTREMELY attractive, despite the obvious single-machine limitations (network shared virtual memory, etc., aside). While I doubt that this capability exists, I am still quite interested in the shared-memory extension, but don't see a document for it on the core tape to correspond with those on shape, pex, multibuffering, or xinput. I would be happy to RTFM if I knew where it was. Hints, anyone? Randy Brown (uunet!erik!rbrown) P.S.: By the way, as an R5 wish: It would be very useful to us to be able to share pixmaps with the server, passing only id's through the protocol in place of the entire data block, which is usually 1MB and will range much higher. We would be willing to adapt to server formats where necessary, as long as the data is organized with the bits of a pixel contiguous and not the bits of a plane. In my naivete, it seems fairly simple for the server to return the offset within a shared memory region at which the bitmap portion of a pixmap resides, and for the client to then attach that region and access the data directly. It also seems fairly simple for Xlib to determine that a bitmap is in the shared region and pass its offset. Though this would require new versions of all those protocol blocks that include bitmap data, the old versions need not be changed. If the server allocates the space in the shared memory, a single region could be shared among all clients on those systems with limited resources for shared memory descriptors (think of the security problems!) or the server could allocate a new shared memory region for each connection requesting a shared pixmap; well-behaved clients couldn't tell the difference. P.P.S.: Just so you won't think the above request too far out, suppose I were to suggest that it's possible to pass the server a pathname and an offset, requesting it to open the pathname, mmap, and access its bitmap data at that offset? If you had some image processing hardware and wanted to avoid passing the data through the cpu, the client process, and the X protocol, instead allowing a bus mastering graphics board to just go get it, or the cpu (server) to poke your image processing hardware to move it onto your slave graphics board, when sent an XCopyArea with the right pixmap id or multiple buffer id, you might have such pipe dreams. Now doesn't shared memory seem simple and conservative, and of universal interest?
rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (10/03/90)
I have seen assertions in this group that the shared-memory extension allows for client-server sharing of pixmaps. Yes, it does. I would be happy to RTFM if I knew where it was. There isn't one. Use the Source, Luke. mit/extensions/include/ XShm.h, shmstr.h mit/extensions/lib/ XShm.c mit/extensions/server/ shm.c mit/extensions/test/ shmtest.c