Skip to content

Trax Image Formats: Shared Memory #31

@cybertk

Description

@cybertk

Regarding to #29. I'm considering implement a shared memory solution based on POSIX <sys/shm.h>. The changes of code should be

  1. Add a new type TRAX_IMAGE_SHM with protocol text shm

  2. In libtrax, add a new shared memory container trax_shm_region, it's struct should be

     struct trax_shm_region {
         char* shm_id;
         void* ptr;
     }
    
  3. trax_shm_region will attach to Image.data for TRAX_IMAGE_SHM type.

  4. For Python binding, will add a new class ShmImage in image.py

The communication flow should be

  1. TraxClient requests a shared_memory_region identified by shm_id through shm_open() and mmap()
  2. TraxClient fills the image into shared_memory_region , and send trax text shm://trax-NNNN;width;height;format
  3. TraxServer receives trax text and parses the shm_id
  4. TraxServer attaches to the shared_memory_region identified by shm_id

Other notes

  1. Shared memory should works in POSIX system only, Linux and macOS should be supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions