Exchanging data with a C program using shared memory (sysV IPC)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Al

    #1

    Exchanging data with a C program using shared memory (sysV IPC)

    Hello,

    I want my python application to communicate with an legacy C program which
    read/write data in a shared memory (Unix Sys V IPC).

    It seems that there are no official shm nor sysV ipc module, and that
    non-official ones are dead. I can't modify the C code to change its
    communication method.

    How would you solve this problem using python ?
    Is there any reason there is no official shm for python ?


    I could write a C code which communicates with my python application
    using mmap or something else and with the old C code using shmat(), but
    this is a rather ugly solution.

    Thanks in advance.

    ---
    Al

  • slacker

    #2
    Re: Exchanging data with a C program using shared memory (sysV IPC)

    Al wrote:
    [color=blue]
    > I want my python application to communicate with an legacy C program which
    > read/write data in a shared memory (Unix Sys V IPC).[/color]

    Have you looked at the dl module? Types and portability aside, it
    might provide you with what you need.

    Cheers,

    - slacker

    Comment

    • Al

      #3
      Re: Exchanging data with a C program using shared memory (sysV IPC)

      "slacker" <brendan.rankin @gmail.com> writes:

      Hello slacker,
      [color=blue]
      > Al wrote:
      >[color=green]
      >> I want my python application to communicate with an legacy C program which
      >> read/write data in a shared memory (Unix Sys V IPC).[/color]
      >
      > Have you looked at the dl module? Types and portability aside, it
      > might provide you with what you need.
      >
      > Cheers,
      >
      > - slacker[/color]

      Thank you very much for your advice. I didn't use the dl module, but
      searching information on dl, led me to the 'new' ctype one which
      is perfect for my use.


      --
      Al

      Comment

      Working...