09 June

How to define variables in shell script?

In this post we will learn how to define variables in shell script. A variable is used to store any value. The value can be an integer, float, character or even a string. There is not need to write the data type as is the case with C or C++ languages. For example x=1 y=2.5 […]

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 […]

31 May

Deadlock Detection and Recovery

If a system neither uses deadlock prevention nor a deadlock avoidance strategy then it might enter into a deadlock. Thus, it becomes important to use deadlock detection and recovery policy. A Deadlock detection algorithm, determines whether the system is in deadlock state or not? If yes, then the system uses a deadlock recovery method to […]

26 May

Race Condition

Critical Section Problem

When multiple process run in the system, they might at times want to access the same resource at same time. This situation can lead to unwanted results. To understand the issues – race condition and critical section problem, related with process synchronization lets consider a situation as below: Let:  counter = 5 If I run […]