Programming

  • Network Socket Programming using UDP in C

    1.0 Datagram sockets

    There are two major types of network sockets, viz. Stream sockets (SOCK_STREAM) and Datagram sockets (SOCK_DGRAM). The socket type defines the semantics of communication between this socket and its remote counterpart. Stream sockets provide full-duplex reliable sequenced data streams. Datagram sockets support connection-less unreliable messages between the ...

  • Network Socket Programming using TCP in C

    1.0 Client-server model

    Client - Server System

    Client server model is a software architecture paradigm prevalent in distributed applications. A server has information resources and processes that provide answers to queries and other services to remote ...

  • Signals in Linux

    Timeout

    1.0 Signals

    Signals are software interrupts that are delivered to a process by the kernel. A signal indicates that an event has occurred and the process must take note of it. A signal is delivered asynchronously to a process. Whatever the process was doing is suspended and the ...

  • D-Bus Tutorial

    1.0 D-Bus

    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. The libdbus library is an implementation of the wire protocol. It provides the C Language ...

  • Interprocess communication using POSIX Shared Memory in Linux

    1.0 Shared Memory

    Shared memory, message queues and semaphores form the suite of interprocess communication (IPC) mechanisms available under Linux and other Unix-like systems. In case of shared memory, the system provides a shared memory segment which the calling process can map to its address space. After that, it behaves just like any other part of ...

  • Interprocess communication using System V Shared Memory in Linux

    1.0 Shared Memory

    Shared memory is one of the three interprocess communication (IPC) mechanisms available under Linux and other Unix-like systems. The other two IPC mechanisms are the message queues and semaphores. In case of shared memory, a shared memory segment is created by the kernel and mapped to the data segment of the address space ...

  • Queue implementation in C using linked list

    1.0 Queue

    A queue is a data structure with two end points, its head and the tail. Initially, the queue is empty. There are two basic operations available for a queue, enqueue and dequeue. The enqueue operation adds an element to the queue. Elements are added to a queue at its tail. The dequeue operation takes ...

  • POSIX Threads Synchronization in C

    1.0 POSIX Threads Synchronization

    POSIX Threads provide multiple flows of execution within a process. The threads have their own stacks but share the global data and 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 ...

  • POSIX Threads Programming in C

    1.0 POSIX threads

    A process is an execution environment in an operating system. A process has code and data segments which are initialized from a program during an exec system call. A process has a thread of execution, wherein instructions are executed as per the value of the program counter ...

  • POSIX Semaphores

    1.0 Semaphores

    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 ...

  • System V Semaphores

    1.0 Semaphores

    A semaphore is a mechanism for synchronizing processes and threads. Semaphore, in Unix-like systems, are provided under interprocess communication (IPC) facilities along with message queues and shared memory. While message queues can be used by themselves for interprocess communication, semaphores are needed for implementing shared memory based interprocess communication systems. Semaphores ...

  • Semaphore Basics

    1.0 BACKGROUND

    Semaphore

    A semaphore is a signalling mechanism used to regulate access to a shared resource like a railroad track. A semaphore is used to signal to the driver of a train whether he can go ahead on the track or not. The upward ...

  • Interprocess communication using POSIX message queues in Linux

    1.0 POSIX Message queues

    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 ...

  • Interprocess communication using System V message queues in Linux

    1.0 Message queues

    Message queues are one of the interprocess communication mechanisms available under Linux. Message queues, shared memory and semaphores are normally listed as the three interprocess communication mechanisms under Linux. Semaphores, though, are really for process synchronization. In practice, shared memory, aided by semaphores, makes an interprocess communication mechanism. Message queues is the other ...

  • Interprocess communication using FIFOs in Linux

    1.0 FIFO

    FIFOs are pipes with a name and are also commonly referred to as named pipes. Pipes are common on Linux command lines but do not have a system-wide name. So, any two processes that wish to communicate using a pipe need to be related, either parent and child or, sharing a common parent, who ...

  • Interprocess communication using pipes in Linux

    1.0 Interprocess communication

    A process is an active operating system entity which executes programs. Normally, a process, like a specialist, does one particular job (well). In real life, there are complex workflows and we, often, have multiple processes collaborating to accomplish certain objectives. In order to work together, processes need to exchange data. ...

  • Creating processes with fork and exec in Linux

    1.0 fork and exec system calls

    The use case is to execute a program in Linux environment. To execute a program, a process needs to be created. So, some process, already in existence, has to create a process for the program to be executed. In a typical ...

  • Program, Process and Threads

    PROGRAM

    The definition of program is linked to the definition of algorithm. An algorithm is a sequence of finite steps which can be executed mechanically to solve a problem. The key points are that algorithms are self-contained; the steps given are sufficient to solve the problem at hand. No additional ...