written 5.9 years ago by |
Software is the basic building block of RTOS. Task is a simply subroutine. Task must be able to communicate with one another to coordinate their activities or to share the data.
Kernel object is used for inter task communication. Kernel objects uses message queue, mail box and pipes, Shared Memory, Signal Function and RPC a for inter task communication.
Message queue:-
A message queue is a buffer like data structure, through which tasks and ISRs communicate with each other by sending and receiving messages and synchronize with data.
It temporarily stores the message from a sender until the intended receiver is ready to read them.
A message queue has queue control block, queue name, unique ID, memory buffers, a queue length. Kernel allocates the memory for message queue, ID, control block etc.
Mail box:-
In general, mailboxes are similar to message queues. Mail box technique for inter task communication in RTOS based system used for one way messaging.
The task/thread creates mail box to send the message. The receiver task can subscribe the mail box. The thread which creates the mail box is known as mailbox server.
The others are known as client. RTOS has function to create, write and read from mail box. No of messages (limited or unlimited) in mail box have been decided by RTOS.
Pipes :-
- Pipes are kernel objects used for unstructured data exchange between tasks facilities synchronization among tasks. Pipe provides a simple data transfer facility.
Shared Memory :-
- Shared memory is simplest way of inter process communication. The sender process writes data into shared memory and receiver process reads data.
Signal Function:-
Operating system provides the signal function for messaging among task (process).
Remote Procedure Call(RPC) and Sockets:-
RPC is a mechanism used by process(task) to call the procedure of another process running on same or different CPU in the network.
Sockets are used for RPC communication and establishes full duplex communication between tasks.