473,796 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Al
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

Jun 27 '06 #1
2 4989
Al wrote:
I want my python application to communicate with an legacy C program which
read/write data in a shared memory (Unix Sys V IPC).


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

Cheers,

- slacker

Jun 27 '06 #2
Al
"slacker" <br************ @gmail.com> writes:

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


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

Cheers,

- slacker


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

Jun 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
2966
by: John DeSoi | last post by:
I get this when I try to start up a freshly compiled beta4 on OS X 10.2.6: FATAL: could not create shared memory segment: Invalid argument I saw a previous thread on this for beta2. It sounded like this was a bug that was to be fixed in beta3, but I'm still having this problem with beta4. Thanks,
2
2518
by: socket | last post by:
Hey, I need to make two programs I wrote to communicate with each other, but what's the best way to implement it? Both programs will be running on the same machine. I don't want to open sockets and transfer the data 'network style' because of security issues. The data transfer is only one way, program A will be sending streams of data to program B, and program B will output the data.
1
2746
by: priyachari | last post by:
Can anybody here suggest me whether loading an XML file directly into a shared memory is possible through IPC or should i parse the XML file and load the contents into an structured array and load it into memory...
19
6344
by: Zytan | last post by:
I want multiple instances of the same .exe to run and share the same data. I know they all can access the same file at the same time, no problem, but I'd like to have this data in RAM, which they can all access. It seems like a needless waste of memory to make them all maintain their own copy of the same data in RAM at the same time. What's the best way to achieve this? I've heard of memory mapped files, so maybe that's the answer. ...
4
4531
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst child apps of an IIS application and can be used by multiple users during the application life cycle and for multiple page loads for the same or different page under a root application. What I don't understand and need to know is whether that...
1
3341
by: cavemandave | last post by:
hi people i have been teaching myself C for the last few months and have recently moved onto ICP shared memory. I have with aid developed some simple code that prints out some chars i then wanted to do the same with int but cannont seem to get it to work. producer #include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h> #include <stdio.h>
2
2021
by: Pramod | last post by:
Please let me know if we can use Shared Memory in dot net? and what is the difference between IPC Channel and Shared Memory? Does IPC Channel uses named pipes/shared memory? Thanks in advance. -PC CC
3
2537
by: Blubaugh, David A. | last post by:
To All, I was wondering if it was possible to utilize python to share a memory resource between a linux and windows system?? It should be stated that both the Linux (CENTOS 5) and windows are physically located on the same computer. Is any of this possible?
3
1660
by: walsug | last post by:
hello, I've just finished an program migration from linux system V IPC to Windows Interprocess communication(include other system calls,of course). Now I have to take effort to re-develop it with JAVA,but it seems that java itself has little to do this,or it has but I don't know.The OS kernel mechanism I used include process,thread,semaphore,mutex,filelock,pipe(or message queue),filemapping(or shared memory),etc. I would be so grateful if...
0
9684
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10017
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7552
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.