Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Arnab Chakraborty
Page 165 of 377
Process Representation in Linux System
Linux manages processes using a fundamental data structure called task_struct, which contains all the information needed to represent a process in the system. This structure is defined in the header file within the kernel source code. Process Data Structure The task_struct is a comprehensive C structure that holds critical information about each process, including: Process state − Current execution state (running, waiting, stopped) Scheduling information − Priority, time slices, and scheduler-specific data Memory management − Virtual memory layout and page tables File descriptors − List of open files and I/O resources Process relationships − Parent, ...
Read MoreHow to create a process in Linux?
A process is a program loaded into memory and currently executing. In simple terms, a process is a program in execution state that the operating system manages and schedules for CPU time. Creating Processes with fork() System Call In Linux, a new process is created using the fork() system call. This system call creates a new process by making an exact copy of the calling process's address space. The original process becomes the parent process, while the newly created process becomes the child process. When fork() is called, both parent and child processes continue execution from the ...
Read MoreBig Endian and Little Endian
Big Endian and Little Endian are two different ways that computer systems store multi-byte values in memory. The terms refer to which byte (most significant or least significant) is stored first in a sequence of memory addresses. Byte Order Storage Methods Little Endian − The least significant byte (low-order byte) is stored at the starting address (A), and the most significant byte (high-order byte) is stored at the next address (A + 1). Big Endian − The most significant byte (high-order byte) is stored at the starting address (A), and the least significant byte (low-order byte) is ...
Read MoreWhat are Named Pipes or FIFO in Linux/Unix systems?
Named Pipes (also called FIFO - First-In-First-Out) are a mechanism for inter-process communication (IPC) in Linux/Unix systems that allows unrelated processes to communicate with each other. Unlike anonymous pipes, which work only between parent and child processes, named pipes create a special file on the filesystem that can be accessed by any process with appropriate permissions. Named pipes support bidirectional communication, meaning data can flow in both directions through a single pipe, making them more versatile than regular pipes for complex communication scenarios. Creating Named Pipes There are two primary ways to create named pipes in Linux/Unix ...
Read MoreInit process on UNIX and Linux systems
The Init process is the parent of all processes in UNIX and Linux systems, executed by the kernel during system boot. Its primary role is to create processes from configuration stored in /etc/inittab. Init spawns getty processes on terminal lines for user logins and controls all autonomous system processes required for proper operation. After reading /etc/inittab, init determines how the system should be configured for each runlevel and sets the default runlevel. Init then starts all background processes after establishing the system's operational state. Process Hierarchy Process Tree Structure ...
Read MoreLinux Process Monitoring
In Linux, the top command is a powerful utility used to monitor running processes in real-time. It displays an ordered list of active processes and updates regularly, showing critical system information like CPU usage, memory consumption, swap memory, cache size, buffer size, process IDs (PIDs), users, and commands. This tool is essential for system administrators to identify processes consuming high memory and CPU resources. How Top Command Works The top command provides a dynamic view of the system's running processes. It refreshes every few seconds by default and sorts processes by CPU usage, with the most resource-intensive processes ...
Read MoreWhat's the difference between a context switch, a process switch and a thread switch in Linux?
Context switching is the fundamental mechanism that allows a multitasking operating system to share a single CPU among multiple processes and threads. It involves storing the current execution state so that it can be restored later, enabling seamless resumption from the same point. Types of Context Switches There are three main types of context switches in Linux, each with different overhead costs and complexity levels. Context Switch (General) A context switch is the general term for saving the current execution state (registers, program counter, stack pointer) of a running task and loading the state of another ...
Read MoreWhat is loopback address?
The loopback address is a special IP address range (127.0.0.0 – 127.255.255.255) reserved for internal communication within a single computer system. The most commonly used loopback address is 127.0.0.1, also known as localhost. This address allows processes on the same machine to communicate with each other through the network stack without requiring physical network hardware. How Loopback Addresses Work When a process sends data to a loopback address, the operating system intercepts the packet and routes it back to itself internally. The data never leaves the computer or passes through the Network Interface Card (NIC). Instead, it is ...
Read MoreConsistency Semantics for File Sharing
File-sharing services have become an integral part of modern communication and collaboration. These services allow users to share files with others, enabling them to work together on projects and exchange information. However, with multiple users accessing and updating the same file simultaneously, the problem of data consistency arises. Data consistency refers to the correctness and reliability of data, ensuring that all users see the same view of the data at all times. Consistency semantics is a set of rules that define how data is accessed and updated by different users in a distributed system. It ensures that all users ...
Read MoreConvoy Effect in FCFS
In computer operating systems, scheduling algorithms play a crucial role in managing the execution of multiple processes. The First-Come-First-Serve (FCFS) scheduling algorithm follows a sequential order in executing processes as per their arrival time in the system. Although FCFS is straightforward and easily implementable, it may result in the Convoy Effect, where a resource-intensive process monopolizes system resources and creates a backlog of smaller processes, causing delays and inefficiencies. First Come First Serve (FCFS) Scheduling First-Come-First-Serve (FCFS) is a non-preemptive scheduling algorithm where processes are executed in the order they arrive in the ready queue. When a process ...
Read More