Welcome to SoftPrayog.in

SoftPrayog provides information regarding Linux system programming, C programming, GNU-Linux commands, troubleshooting and general software engineering concepts.

What’s new

Dining philosophers problem

Dining philosophers problem

The dining philosophers problem was formulated by Edsger Dijkstra in 1965. The problem illustrates synchronization issues in systems made up of concurrent tasks. The objective of the problem is to have progress and avoid deadlock in systems… Read more

C Programming Tutorial 5: Structures and Unions

A structure, in the C programming language, is a collection of variables for an entity. The variables are known as members of the structure and are located at consecutive memory locations. The size of the structure is the sum of sizes of the members plus any padding that might be placed by the system… Read more

C Programming Tutorial 4: Pointers and Arrays

A pointer variable holds the address of another variable. It is said to be “pointing” to that variable. For example, "int *ip;" defines a variable ip of type integer pointer. ip points to a variable of type integer. At the implementation level, it holds the address of a variable to type integer… Read more

C Programming Tutorial 3: Control Flow and Functions

A C program comprises of global data and functions. A program must have a main function and the execution starts at the first statement in the main function. A function has local data and statements. The control flow deals with the order in which statements are executed by a program… Read more

C Programming Tutorial 2: Data Types and Expressions

A C programming tutorial explaining data types, declarations, operators, conditional expressions and prcedence and associativity rules… Read more

C Programming Tutorial 1 – Getting Started

C is a procedural programming language invented by Dennis Ritchie in 1972. C is, possibly, the most widely used programming language in the last fifty years. There are some unique features of C. It is a small language; so it can be easily learnt. It can be used for almost all kinds of programming tasks… Read more

Featured articles

I/O multiplexing: select, poll and epoll in Linux

I/O multiplexing

I/O multiplexing is the the ability to perform I/O operations on multiple file descriptors. Input operations like read, accept and calls for receiving messages block when there is no incoming data. So, if an input call is made and it blocks, we may miss data from other file descriptors. To circumvent this, I/O multiplexing calls, viz., select, poll, and the epoll API calls, are provided… Read more

D-Bus Tutorial

D-Bus is a mechanism for interprocess communication under Linux and other Unix-like systems. D-Bus has a layered architecture. At the lowest level is the D-Bus wire protocol described in the D-Bus Specification… Read more

POSIX Shared Memory in Linux

Shared memory is the fastest method of interprocess communication (IPC) under Linux and other Unix-like systems. The system provides a shared memory segment which the calling process can map to its address space… Read more

POSIX Semaphores in Linux

Semaphores are used for process and thread synchronization. Semaphores are clubbed with message queues and shared memory under the Interprocess Communication (IPC) facilities in Unix-like systems such as Linux. There are two varieties of semaphores, the traditional System V semaphores and the newer POSIX semaphores. In this post we will look at the POSIX semaphores… Read more

POSIX message queues in Linux

POSIX interprocess comunication (IPC) was introduced in the POSIX.1b standard (IEEE Std 1003.1b-1993) for real time extensions. POSIX message queues have been made available in Linux since the version 2.6.6 (May 2004). POSIX IPC calls are as per the standard but may not be available on older Unix-like systems. Compared with the System V IPC calls, the POSIX IPC calls have a cleaner interface and are easier to use… Read more

POSIX Threads Synchronization in C

POSIX Threads provide multiple flows of execution within a process. The threads have their own stacks but share the global data and the heap. So the global variables are visible to multiple threads. Also, the threads need to synchronize their actions so that they jointly realize the overall objectives of the process they belong to. Read more

fork and exec system calls in Linux

The relationship between fork and exec system calls and how to use them is explained with an example. Read more

Videos

Subscribe to YouTube channel