Wednesday, May 20, 2015

Inter/Intra Process Communication Part-1


I am in love with technology...but this love is difficult.  Technology is so vast , that its hard to get a good grip on something.

Now while going thru the VoLTE post, I realized I need to study something about sockets.

That has led me to study about IPC ( Inter Process Communication)

As per wikipedia there a lot of ways to have IPC.

But I will just focus on those which I see in code or come across my daily life.


They will be

1) Pipes

2) Sockets

3) Message Queue

4) Shared Memory

5) Semaphore

6) Signal

Now what I am looking for is differences between these approaches and simple code for these.

This is nice link on wiki  http://en.wikipedia.org/wiki/Inter-process_communication


A bit knowledge about Operating System , since if things goes as planned :)  then we will need conceptual wise understanding of OS concepts.

Process is a executable code of the program you have written.

Threads are the running instances of you process ( or executable code) . There can be many threads per process, depending on OS support.

Also threads common to same process share the memory and variables.

True multitasking happens in CPU having more than one core or processor.  For single processor, we have time-slice concept where we slice time between different threads to have a feel of multitasking.

Multitasking is a broader term , which means multiple task running at same time. Task are nothing but threads ( IMP POINT is  THEY CAN BE OF SAME PROCESS OR DIFFERENT PROCESS).

So multiprocessing system are nothing but multitasking system.  In most of the books they just use multiprocessing in place of multitasking , even though their meaning might meant  SINGLE PROCESS MULTIPLE THREADS running at the same time.


So given this context, we have to see how can we send data between

1) THREADS OF SAME PROCESS.  Can be term as intra-process communication
2) THREADS OF DIFFERENT PROCESS . in short  inter-process communication.


So now basically we know why we are studying about IPC.

Things to done by me :
1) Making C program which have 2 threads


Some useful links I came across/referred during this post

1) http://www.yendor.com/programming/unix/unp/unp.html

2) http://technotif.com/basic-guide-interprocess-communication-pipes/

3)https://www.google.co.kr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&ved=0CDwQFjAE&url=http%3A%2F%2Fwww.cs.unc.edu%2F~dewan%2F734%2Fcurrent%2Flectures%2F6-ipc.pdf&ei=qU5dVduCGsjBmAWv0YD4CQ&usg=AFQjCNFE9VYmu5VPnnr7uxILm8M0Z3yHtA&sig2=KEhqnHdHF9KK7E0NSiK5ig&bvm=bv.93756505,d.dGY
4)


No comments:

Post a Comment