Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
IPC

IPC

Ratings: (0)|Views: 259|Likes:
Published by Assini Hussain
Inter Process Communication
Inter Process Communication

More info:

Published by: Assini Hussain on Oct 30, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/30/2012

pdf

text

original

 
Embedded SystemsModule 3
Inter Process Communication:
Exchange of data between two or more separate, independent processes or threads or tasks or ISR or scheduler 
OSes provide the following IPC functions:1.Signal for other process to start2.Semaphore (as token, mutex) or counting semaphores for the inter task communication between tasks sharing a common buffer 3.Queues and Mailbox
4.
Pipe and Socket devices5.Remote procedure call (RPC) for distributed processes.Signal functions:
One way for messaging is to use an OS function signal ( ).
Provided in UNIX, Linux and several RTOSes.
A signal is the software equivalent of the flag at a register that sets on hardwareinterrupt. Unless masked by a signal mask, the signal allows the execution of thesignal handling function and allows the handler to run just as a hardware interruptallows the execution of an ISR 
Signal is an IPC used for signaling from a process A to OS to enable start of another  process B
Signal is a one or two byte IPC from a process to the OS.
Signal provides the shortest communication.
The signal ( ) sends a one-bit output for a process, which unmasks a signal mask of a process or task (called signal handler)
The handler has coding similar to ones in an ISR runs in a way similar to a highest priority ISR.
An ISR runs on hardware interrupt provided that interrupt is no masked. The signalhandler also runs on signal provided that signal is no masked
Signal ( ) forces a signaled process or task called signal handler to run.
When there is return from the signaled or forced task or process, the process, whichsent the signal, runs the codes as happens on a return from the ISR.
OS connects a signal to a process or ISR j (called signal handler function), and resetsthe signal mask of j.
Then the j runs after all higher than j priority processes (or ISRs) finish.
An OS provision for signal as an IPC function means a provision for interrupt-message from a process or task to another process or task 
Some signal related IPC functions are:
1.
SigHandler ( )
to create a signal handler corresponding to a signalidentified by the signal number and define a pointer to signal context. Thesignal context saves the registers on signal.
Inter Process Communications: Signal functionsPage 1
 
Embedded SystemsModule 32.
Connect 
an interrupt vector to a signal number, with signaled handler function and signal handler arguments. The interrupt vector provides the program counter value for the signal handler function address.
3.
A function
 signal ( )
to send a signal identified by a number to a signalhandler task 
4.
 Mask 
the signal
5.
Unmask 
the signal
6.
 Ignore
the signalComparison between signal and semaphore:
Some OSes provide the signal and semaphore both IPC functions
Every OS provides semaphore IPC functions.
When the IPC functions for signal are not provided by an OS, then the OS employssemaphore for the same purpose.
An eg. Task A sending signal s
B
to initiate Task B (signal handler) to runTask A sending semaphore as event flag sem
i
to initiate task section waiting to takesem
i
before it could run
Inter Process Communications: Signal functionsPage 2

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->