14 April

Program for IPC using Message Queues

Program for IPC using Message queues are almost similar to named pipes with the exception that they do not require the opening and closing of pipes. But, they face one similar problem like named pipes; blocking on full pipes. Message queues send blocks of data from one process to another. Each block of data is […]

09 April

Program on Dining Philosopher Problem

In this post we are going to understand the C program implementing the solution to the Dining Philosopher Problem. The Dining Philosopher Problem states that there are five philosophers which do two thinks: think and eat. They share a table having a chair for each one of them. In the center of the table there […]

07 June

How to get OS version in C?

In this post we are going to solve a common question that dazzles most programmers – How to get OS version in C? When building an application sometimes a requirement is to check the operating system version. Programmers find it difficult to achieve this in C language. The solution to the above question is using […]

10 May

Program for wait() system call

When a process creates a child process, sometimes it becomes necessary that the parent process should execute only after the child has finished. wait() system call does exactly this. It makes the parent process wait for child process to finish and then the parent continues its working from the statement after the wait().To be exact […]

13 April

Program for IPC using named pipes (mkfifo())

Program for IPC using named pipes (mkfifo()) The third method for IPC is using mkfifo() function. mkfifo() creates a named pipe which can be used exactly like a file. So, if you know how to read/write in a file this is a convenient method for IPC Syntax: #include<sys/types.h>#include<sys/stat.h>int mkfifo(const char *pathname, mode_t mode); mkfifo() makes […]