0
2.0kviews
State and explain Inter process/ task communication tools.
1 Answer
0
38views

In C, C++ or any other high level language, one function can call another function, but no task can call another task. Tasks must be able to communicate with one another to coordinate their activities or to share the data. RTOS have kernel objects for ITC. These kernel objects are-

i) Message Queue:

  • A message queue is a buffer-like object through which tasks and ISRs send and receive messages to communicate and synchronize with data.
  • A message queue is like a pipeline. It temporarily holds messages from a sender until the intended receiver is ready to read them.
  • This temporary buffering decouples a sending and receiving task; that is, it frees the tasks from having to send and receive messages simultaneously.
  • RTOS kernel assigns a unique ID to message queue.
  • It creates associated Queue Control Block and task-waiting list.

Message Structure

ii) Mail boxes:

  • They are much similar to message queues.
  • They are used for one way messaging.
  • The implementation of mailbox is RTOS dependent.

iii) Pipes:

  • A traditional pipe structure is given by

Pipe Structure

  • When pipe is created, the 2 descriptors, one for sending and another for receiving are returned.
  • Pipe is used to exchange data between a data producing task and a data consuming task.

  • Pipe has 3 states viz. Empty, Non-empty and Full. Empty state is when pipe is empty, Non-empty state is when the pipe has some data and Full state is when the pipe is full.

State Diagram

Please log in to add an answer.