Skip to main content

Posts

Showing posts from July, 2018

CAN

IPC mechanism

What is IPC? IPC is a mechanism that involves communication of the one process with another process. This usually occurs only in one system. Communication can be of 2 types , Between related processes initiating from only one process, such as parent and child processes.     Between unrelated processes, or two or more different processes. How to do IPC?? What are the ways?  Pipes Communication between two related processes. The mechanism is half duplex meaning the first process communicates with the second process. To achieve a full duplex i.e., for the second process to communicate with the first process another pipe is required. FIFO Communication between two unrelated processes. FIFO is a full duplex, meaning the first process can communicate with the second process and vice versa at the same time. Message Queues Communication between two or more processes with full duplex capacity. The processes will communicate wit...

fork() in C

fork() in C ·             Fork system call use for creates a new process, which is called child process . ·       This child process runs concurrently with Parent process (The Process from which fork() is called). ·       After a new child process created, both processes will execute the next instruction following the fork() system call. ·       A child process use same PC(program counter), same CPU registers, same open files which use in parent process. Argument: 0 Return Value: Negative Value : Creation of a child process was unsuccessful. Zero :                   Returned to the newly created child process. Positive value :     Returned to parent or caller. The value contains process ID of newly created child process. 1. Pr...