Interprocess communication status


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Interprocess communication status
# 1  
Old 07-13-2005
Interprocess communication status

hello gurus,

I was wondering if someone would help me shed more light on this command.
What I know so far is
ipcs - stands for inter-process communication status and it reports on the following types of system resources.
1) Message queues
2) Shared memory and
3) Semaphores

Please explain in some detail what these types of resources mean. Thanks
# 2  
Old 07-13-2005
Let us start at the beginning. In unix, if you want more than one process to access some information what do you do? You could open a file and read/write to and from it everytime, but this would be most inefficient, considering the disk IO that is involved - and imagine the file getting deleted while in use! So you would require some sort of repository in the memory, that can be accessed by any process that has need of it.

Now memory access means that you could just do a malloc and get a pointer that gives you access to memory that is as big as you have requested for (or have been given by the OS). But how does a process tell another process that is not its child what location the pointer is pointing at?

So the Creators hit upon a solution. Three different ways of interprocess communication were implemented - message queues, shared memory and semaphores.

Each can be used by unrelated processes (they use something called keys to return another value called the id - and one key can map only to one id - so multiple programs working together can use the same key to access the same queue/memory/semaphore).

Message queues are like FIFOs; messages sent to a message queue are all appended to the end, but retrieving a message from the queue can be done in different ways - the first message, the first message of a certain type or the first message different from the message of certain type. Check out this page for more details on how to use message queues.

Shared memory is obvious, different processes access the shared memory by again mapping the key to an id, and directly read from or write to the memory - this is the fastest you can have processes talking to each other. Check this page for more details on shared memory.

Semaphores are the gate keepers, they are used to determine if shared resoures (such as attached shared memory segments) can be read from or written to safely. Programs that are going to be using shared memory segments will also create or obtain existing semaphores. These mark whether a process is currently reading from or writing to a shared memory segment and consequently whether it is safe to carry out any operations on the shared memory now. Check this page for info on semaphores.

Hope this helps!

Last edited by blowtorch; 07-13-2005 at 10:49 PM..
# 3  
Old 07-13-2005
How about IPCs like:
  • named pipes?
  • signals?
  • sockets?

Neo
# 4  
Old 07-13-2005
The OP had specifically asked for the three forms of IPC..
# 5  
Old 07-15-2005
Thanks for the tips on the types of resources that ipcs. Is there a way in UNIX to determine which process utilize the various IPC resource? the ipcs command only indicates the number of message queues, shared memory segments and semphores that are currently available when the snapshot of the command executed. Please advise. Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to see the status of all the ftp put & get files logs and curent ftp transfer status ?

How to see the status of all the ftp put & get files logs and curent ftp transfer status if any active ftp running in the background ? (2 Replies)
Discussion started by: i4ismail
2 Replies

2. Programming

How to track table status delete/update/insert status in DB2 V10 z/os?

Dear Team I am using DB2 v10 z/os database . Need expert guidance to figure out best way to track table activities ( Ex Delete, Insert,Update ) Scenario We have a table which is critical and many developer/testing team access on daily basis . We had instance where some deleted... (1 Reply)
Discussion started by: Perlbaby
1 Replies

3. Shell Programming and Scripting

Logging/Reading Interprocess Communications

Greetings, I'm posting this in the shell scripting forum because I'm hoping this can be done in BASH or PERL. If not, I'm still open to suggestions of other ways to do it: I've got an iPhone app that's sending some encrypted (SSL) traffic to a server and I'd like to be able to read the... (0 Replies)
Discussion started by: FiZiX
0 Replies

4. UNIX for Dummies Questions & Answers

Interprocess Communication

Hiya Everybody just joined, Not sure if this is the right section:o I require abit of an assistance with IPC! I know there are different types of IPC porcesses like signals, semaphores, mutexes, shared memory, message queues, pipes and sockets. Now say a system has a number of... (4 Replies)
Discussion started by: G.I.Joe
4 Replies

5. Red Hat

Installing RedHat 8.0 onto Dell PowerEdge SC1425 - hdc: status error: status = 0x58

I have successfully installed RedHat 8.0 onto a Dell PowerEdge SC1425 today. This server has two SATA hard drives, and an IDE DVD-ROM drive. Using the following kernel parameters, i successfully installed across both hard drives from CD: ide0=0x1f0,0x3f6,14 vga=791 resolution=1024x768 expert... (5 Replies)
Discussion started by: fishsponge
5 Replies

6. Shell Programming and Scripting

check the status and send an email with status

Hi, We have a text file which has the following data. ISA~00~ ~00~ ~ZZ~VISTN ~ZZ~U1CAD ~051227~183 7~U~00200~000011258~0~P~< GS~FA~EE05J~U1CAD~051227~1831~000011258~X~002002 ST~997~0001 AK1~SH~247 AK2~856~2470001 AK5~A AK2~856~2470002 AK5~A... (3 Replies)
Discussion started by: isingh786
3 Replies

7. UNIX for Advanced & Expert Users

Pipe, interprocess communication

Earlier I posted a question regarding this issue. I managed to go a step further. Anyway, this is another similar question Write a programme that creates a ring of three processes connected by pipes. The first process should prompt the user for a string and then send it to the second process .... (2 Replies)
Discussion started by: scmay
2 Replies

8. UNIX for Advanced & Expert Users

Interprocess communication using pipes and fork

I'm very worried. I have an assignment that is due in 3 weeks, and also tute exercises which I can't seem to understand and work out. Okay, the question: The parent process will convert the command arguments into integer values using atoi() and store them into an integer array which you will... (2 Replies)
Discussion started by: scmay
2 Replies

9. UNIX for Dummies Questions & Answers

serial communication

This isn't really a unix question, or even a programming question, but I hope you guys can help. I want to create a program to control the electricity on a model railway. I have created the program to that it sends characters over the serial cable, but now I need to do the switch that will... (1 Reply)
Discussion started by: KrazyGuyPaul
1 Replies

10. UNIX for Dummies Questions & Answers

Couldn't open status file /var/samba/STATUS.LCK

I believe i have most of samba configured right but i get this error each time time try to run it. I was given suggestion that i touch the file, i did, but i still cannot rid myself of this error. Any suggestions (2 Replies)
Discussion started by: macdonto
2 Replies
Login or Register to Ask a Question