Results 1 to 4 of 4
Hi All
I am currently working on an application system consisting of several processes who interact with each other using the standard IPCs like messages, shared memory and semaphores. I ...
- 04-07-2010 #1Just Joined!
- Join Date
- Jan 2008
- Posts
- 3
Shared memory issues
Hi All
I am currently working on an application system consisting of several processes who interact with each other using the standard IPCs like messages, shared memory and semaphores. I found a peculiar issue. When working in RHEL 5.1 with Linux Kernel 2.6.18.164-el5, I found that a particular process always failed to get the required data from the shared memory. The shared memory attach was correct and had no issues, some of the data from the shared memory were accessible and correct but not all of the data. The rest of the data returned as 0 causing the process to exit abnormally. However, upon testing the same code on RHEL 5.1 with Linux Kernel 2.6.18.53-el5, this works fine no issues whatsoever.
Now this makes me wonder if there any new kernel variables that may need to be set in Kernel 164? I would very much appreciate your help, input and advice.
With Regards
Vardhan
- 04-07-2010 #2Just Joined!
- Join Date
- Apr 2010
- Posts
- 18
Thats interesting. I too use shared memory programming to communicate messages between processes. Mine is linux kernel 2.6.16.46 with SUSE Enterprise. I have not yet faced this error yet but am just in the initial phase of testing. Do let me know if you come across the cause.
btw can you give me some idea on how many messages per second you are able to process between your applications through shared memory IPC. I am getting varied results on that each time. This is my first application with shared memory hence not sure how the results should be. I fork out 4-5 instances of an application and each of them communicate with one central application. I set a timer for 1 second and start a loop to send and receive messages. Initially I was getting 10-11 per second. Later I re-compiled the code after some totally unrelated changes(added logging) and I was getting 100-200 per second. Can you give me some idea on what can be expected with SHM IPC.
- 04-07-2010 #3Just Joined!
- Join Date
- Jan 2008
- Posts
- 3
Hi
I do not know the number of messages/sec etc, the reason being the application system I am working with has more than 200 processes spawned. These process communicate using Message Queues. Shared memory comes in place where there are processes which are very closely related that they refer to the same data for actions.
As far as IPC is concerned, I see it is very fast and should not be problem. Run sysctl -p and search for shm or msg. These variables give you a good estimate as to what your system is configured as far as IPC is concerned. Bottlenecks, if any, will be in these variables.
Hope this helps
With Regards
Vardhan
- 04-07-2010 #4Just Joined!
- Join Date
- Apr 2010
- Posts
- 18
Thanks for the quick response vardhan.
I am just performing some tests passing data(one hard coded sample data structure) in a SHM segment and having 4-5 forked processes trying to read and reply to it. In my end production scenario I would have around 40-50 processes sending and receiving dynamically formed data filled in structures. I tried sysctl like you said but it said permission denied because I dont have administrative privileges on the server. Thank you for your input though and do let me know if there is any design consideration that you may know of in using SHM now or later.
Thanks,


Reply With Quote