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 Mukul Latiyan
Page 14 of 37
What is the maximum number of threads per process in Linux?
Linux manages thread allocation through several system parameters and limits. The maximum number of threads per process is determined by multiple factors including system-wide thread limits, virtual memory availability, and stack size configurations. System-Wide Thread Limit The first approach to check the maximum number of threads is to examine the system-wide limit: cat /proc/sys/kernel/threads-max 61741 This value represents the total number of threads that can exist on the entire system. You can modify this limit using: echo 123456789 > /proc/sys/kernel/threads-max where 123456789 is your desired maximum thread ...
Read MoreThreads vs Processes in Linux
A process is the execution of a program that allows you to perform the appropriate actions specified in a program. It can be defined as an execution unit where a program runs. The OS helps you to create, schedule, and terminate the processes which are used by the CPU. The other processes created by the main process are called child processes. A thread is an execution unit that is part of a process. A process can have multiple threads, all executing at the same time. It is a unit of execution in concurrent programming. Threads within the same process ...
Read MoreUnderstanding .a , .so and .la library files in Linux
In order to understand what the libraries of files with the extensions .a, .so and .la actually mean, we first must be aware of the concept of libraries in Linux. A library in its very simple terms is a collection of pre-compiled pieces of code which are known as functions. Libraries are very useful as they provide reusable functions, classes and data structures. Some examples of libraries in Linux are glibc (GNU version of standard C library), libc (the C standard library). In total we can divide the libraries in Linux into two categories. These categories are − ...
Read MoreUnderstanding stdin, stderr and stdout in Linux
There is a decent chance that if you have used Linux operating systems then you might have encountered the three famous data streams known as stdin, stderr and stdout. All these are different in their functions and have their own uses but one thing common between all three of them is that they are data streams that the shell creates. Let's understand more about what data streams actually mean and how they are beneficial. In terms of computing, a data stream is something that gives us the ability to transfer data from a source to an outflow and vice ...
Read MoreWhat does opening a file actually do on Linux?
When we talk about opening a file in Linux, the process varies depending on the programming language and API being used. However, most high-level languages eventually call either the C library functions or directly invoke the Linux open() system call. This article focuses on what happens at the kernel level when a file is opened in C on a Linux system. The sys_open() System Call At the heart of file opening is the sys_open() system call. When you call open() in C, it eventually triggers this kernel function found in fs/open.c: int sys_open(const char *filename, int ...
Read MoreWhat is fopen() and open() in Linux?
The key difference between fopen() and open() in Linux is that open() is a low-level system call that returns a file descriptor (integer), while fopen() is a higher-level C library function that internally calls open() and returns a FILE pointer with additional buffering capabilities. Understanding open() System Call When you call open(), it invokes the kernel's sys_open() function, which performs several operations to establish the file connection. Here's the simplified implementation: int sys_open(const char *filename, int flags, int mode) { char *tmp = getname(filename); int fd = get_unused_fd(); ...
Read MoreWhat is the Linux Equivalent to DOS Pause?
The Pause command in DOS is used to suspend execution of batch files and displays the message − Strike a key when ready ... Some versions of DOS also allow a comment to be entered on the same line as PAUSE. DOS Pause Example We can use the Pause command to suspend execution of a batch file and display a custom message like "Insert Code" − pause Insert Code Linux doesn't provide a built-in pause command utility by default. However, there are different approaches to achieve the same behavior as ...
Read MoreWhat is the sed in-place flag that works both on Mac and Linux?
The sed command in Linux stands for stream editor and is mainly used to perform functions on files, such as searching, replacing, or inserting text. It is a very useful command-line utility available on Linux systems. However, there's an important difference between operating systems: the BSD sed shipped with macOS requires a mandatory argument with the -i flag, while GNU sed on Linux makes this argument optional. The Cross-Platform Solution The most reliable way to make sed work identically on both Mac and Linux is to use the -i flag with a backup extension. This approach works ...
Read MoreWhat languages have been used to write Windows, Mac OS and Linux OS?
An operating system serves as the backbone of any computing system, managing hardware resources and providing essential services. The three most widely used operating systems — Windows, macOS, and Linux — share fundamental concepts while implementing them using different programming languages and architectural approaches. These operating systems differ not only in their user interfaces and file management systems but also in the programming languages and technology stacks used for their development. Understanding the languages behind these systems provides insight into their design philosophy and performance characteristics. Linux Operating System Linus Torvalds, the creator of Linux, explained his ...
Read MoreWhat Linux utility for sorting processes by network usage?
Linux provides the famous top command utility that displays information about running processes, including their time, process IDs, CPU usage, and much more. However, the top command does not sort processes by network usage, and the display order changes frequently based on CPU consumption. When you need to monitor which processes are consuming the most network bandwidth, you need a specialized tool. NetHogs is the ideal Linux utility for sorting and monitoring processes by their network usage in real-time. What is NetHogs? NetHogs is a command-line network monitoring tool that displays real-time network traffic bandwidth usage for ...
Read More