Found 2003 Articles for Operating System

What is loopback address?

Arnab Chakraborty
Updated on 11-Oct-2019 13:33:08

4K+ Views

The IP address range 127.0.0.0 – 127.255.255.255 is reserved for loopback. Loopback IP address is managed entirely by and within the operating system. These addresses enable the Server and Client processes on a single system to communicate with each other. When a process creates a packet with destination address as loopback address, the operating system loops it back to itself without having any interference of NIC.Data sent on loopback is forwarded by the operating system to a virtual network interface within operating system. This address is mostly used for testing purposes like client-server architecture on a single machine.For example, if ... Read More

What's the difference between a context switch, a process switch and a thread switch in Linux?

Arnab Chakraborty
Updated on 11-Oct-2019 13:31:36

1K+ Views

Context Switching involves storing the context or state of a process or thread so that it can be reloaded when required and execution can beresumed from the same point as earlier. This is a feature of a multitasking operating system and allows a single CPU to be shared by multiple processes.A process switch or process scheduling is to changing one process from another by saving all of the state of the currently executing process, including its register state, associated kernel state, and all of its virtual memory configuration.A thread switch means switching from one thread to another thread within a ... Read More

Linux Process Monitoring

Arnab Chakraborty
Updated on 11-Oct-2019 13:29:29

2K+ Views

In Linux, Top command is utilized to monitor Linux Process which is used frequently used by many systems. It is available under many Linux, Unix like operating system. All the running and active real-time processes in ordered list is displayed and updates it regularly by this Top command. display CPU usage, Swap memory, Cache Size, Buffer Size,Process PID, User, Commands and much more. It shows high memory and CPU utilization of running processes in your machine.The following command to monitor Linux Process is typed and it should access root permission.#topThe output should be like this –

Init process on UNIX and Linux systems

Arnab Chakraborty
Updated on 11-Oct-2019 13:28:00

7K+ Views

Init is the parent of all processes, executed by the kernel during the booting of a system. Its principle role is to create processes from a script stored in the file /etc/inittab. It usually has entries which cause init to spawn gettys on each line that users can log in. It controls autonomous processes required by any particular system.After reading this file, how the system should be set up in each runlevel is determined by init and also set default runlevel. Init starts all background process after setting default runlevel for the system.RunlevelsRunlevel, a software configuration of the system which allows ... Read More

What are Named Pipes or FIFO in Linux/Unix systems?

Arnab Chakraborty
Updated on 11-Oct-2019 13:23:28

3K+ Views

Pipes were meant for communication between related processes. We Cannot use pipes for unrelated process communication. Then to achieve unrelated processes communication, the simple answer is Named Pipes. Even though this works for related processes, it gives no meaning to use the named pipes for related process communication.Unlike pipe, we can use single named pipe that can be used for two-way communication (communication between the server and the client, plus the client and the server at the same time) as Named Pipe supports bi-directional communication.Another name for named pipe is FIFO (First-In-First-Out). Let us see the system call (mknod()) to ... Read More

Big Endian and Little Endian

Arnab Chakraborty
Updated on 11-Oct-2019 13:15:43

17K+ Views

All computers do not store the bytes that comprise a multi-byte value in the same order. Consider a 16-bit internet that is made up of 2 bytes. Two ways to store this value −Little Endian − In this scheme, low-order byte is stored on the starting address (A) and high-order byte is stored on the next address (A + 1).Big Endian − In this scheme, high-order byte is stored on the starting address (A) and low-order byte is stored on the next address (A + 1).To allow machines with different byte order conventions communicate with each other, the Internet protocols ... Read More

How to create a process in Linux?

Arnab Chakraborty
Updated on 31-Jan-2020 10:54:58

14K+ Views

A program loaded into memory and executing is called a process. In simple, a process is a program in execution.Let’s inspect how to create a process in LinuxA new process can be created by the fork() system call. The new process consists of a copy of the address space of the original process. fork() creates new process from existing process. Existing process is called the parent process and the process is created newly is called child process. The function is called from parent process. Both the parent and the child processes continue execution at the instruction after the fork(), the ... Read More

Process Representation in Linux System

Arnab Chakraborty
Updated on 11-Oct-2019 13:06:54

1K+ Views

Linux can manage the processes in the system, each process is represented by a task_struct C data structure. It is found in the include file in the kernel source-code directory. The task vector is an array of pointers to every task_struct data structure in the system. As well as the normal type of process, Linux supports real time processes. All the required information i.e; the state of the process, scheduling and memory-management information, list of open files, and pointers to the process’s parent and a list of its children and siblings are contained in this structure.A process who creates ... Read More

How does a process look like in memory?

Arnab Chakraborty
Updated on 11-Oct-2019 13:04:47

5K+ Views

A program loaded into memory and executing is called a process. In simple, a process is a program in execution.When a program is created then it is just some pieces of Bytes which is stored in Hard Disk as a passive entity. Then the program starts loading in memory and become an active entity, when a program is double-clicked in windows or entering the name of the executable file on the command line. (i.e. a.out or prog.exe)Let’s look at each memory segment and how does a process look like within memory −Figure: Process in MemoryTEXTA process is more than the ... Read More

Deadlock with mutex locks

Arnab Chakraborty
Updated on 11-Oct-2019 13:01:45

7K+ Views

Deadlock can be occurred in a multithreaded Pthread program using mutex locks. Let’s see how it can be occurred. An unlocked mutex is initialized by the pthread_mutex_init() function.Using pthread_mutex_lock() and pthread_mutex_unlock() Mutex locks are acquired and released. If a thread try to acquire a locked mutex, the call to pthread_mutex_lock() blocks the thread until the owner of the mutex lock invokes pthread_mutex_unlock().Let’s take an example, two Mutex locks are created in the following Code −/* Create and initialize the mutex locks */ pthread mutex t mutex1; pthread mutex t mutex2; pthread mutex init(&mutex1, NULL); pthread mutex init(&mutex2, NULL);Next, two threads ... Read More

Advertisements