Shared Memory and Graphics Driver


We are attempting the following:

  1. Use PgShmemAttach() to record a shared memory reference (after
    shm_open(), mmap(), etc).
  2. Use PgDrawImagemx() or PgDrawPhImagemx() where the image data is in
    shared memory.
  3. Call PgFlush() to flush the draw buffer.

I am guessing that when you call PgFlush() the photon application copies the
remaining draw commands to the graphics driver, and since the image is in
shared memory, the image data itself is not copied to the graphics driver
but rather only the memory reference.

The question is, how do we know when the graphics driver is done accessing
the shared memory, so that it is safe for us to update the image again (in
our case, with new data from a frame grabber)?