Dynamic Memory Allocation in C

July 25, 2021 0 Comments

Dynamic Memory Allocation in C, Dynamic memory allocation refers to memory allocation that occurs during the execution of a program and is controlled by the program. The compiler has no information about such memory at compile time. It’s given to programs as and when they’re needed, and it can be deallocated as needed. Dynamic variables …

Share This:

POSIX Shared Memory in Linux

July 25, 2021 0 Comments

POSIX Shared Memory in Linux, A slice of kernel memory is designated as shared memory. This memory is not owned by any process. When a process runs under Linux, it is given a part of the system’s virtual memory. The virtual address space of a process refers to this area of memory. A process can …

Share This:

POSIX Message Queues in Linux

July 24, 2021 0 Comments

POSIX Message Queues in Linux, For IPC, the Linux operating system includes a mechanism called Message queue. Message queues allow processes on the same computer to share data. A process can either construct a new message queue or use one that has already been created by another process. The ID of a message queue is …

Share This:

Synchronization methods in Linux

July 17, 2021 0 Comments

Synchronization methods in Linux, There are two types of synchronization methods. Atomic Operations: Operations that read or change data in a single uninterrupted step are called atomic operations. GCC atomic memory access built-in functions: Atomic fetch and operation functions: All above functions return the value that had previously been in memory before performing the suggested …

Share This:

Pthreads in Linux

July 10, 2021 0 Comments

Pthreads in Linux, User-level threads create with the help of user-level thread libraries. which will provide some interfaces through which we can create and manage user-level threads. each user-level thread will contain its own stack and code segment. Each thread creates in the user space by thread library will maintain a data structure. thread library …

Share This:

Process Creation in Linux

July 10, 2021 0 Comments

Fork: Process Creation in Linux, fork() creates a new process by duplicating the calling process. A fork creates a new process or child process exactly the same as its parent process by duplicating address space in user mode and PCB in kernel mode because of this duplication whatever the instruction appears after the fork call …

Share This:

Signals in Linux

July 3, 2021 0 Comments

Signals in Linux, Signals are Asynchronous events deliveres to a process by the signal subsystem in order to notify the process about an event that occurred. Linux supports 64 signals. Linux provides two different categories of signals. General-purpose signals: Use as system event notifications. each signal identified with a name or an integer value which …

Share This:

File I/O Calls in Linux

June 7, 2021 0 Comments

File I/O Calls in Linux, The Linux Kernel supports different types of file I/O operations. Standard I/O: read: #include <unistd.h> ssize_t read(int fd, void *buf, size_t count); ReadAPI invokes FS-specific write operation through VFS system call sys_read. read() attempts to read up to count bytes from file descriptor fd into the buffer starting at buf. write: #include <unistd.h> …

Share This:

File Systems in Linux

June 2, 2021 0 Comments

File systems in Linux, File systems are services in an operating system that will manage files over the disk. File system organized disk into four. File system Block (Superblock and Inode Block) Boot Block Super Blockfile 0+1+1+1Dentry 0+1 Inode Blockxyz.txt p flags block 3abc.txt p flags block 5text.txt p flags block 9dr p flags Data …

Share This:

File I/O Operations in Linux

June 1, 2021 0 Comments

File I/O Operations in Linux open: #include <sys/stat.h> #include <fcntl.h> int open(const char *pathname, int flags); int open(const char *pathname, int flags, mode_t mode); The open() system call opens the file specified by pathname. If the specified file does not exist, it may optionally (if O_CREAT is specified in flags) be created by open(). The …

Share This: