Operating Systems

OS Synchronization Mechanisms

In modern operating systems, efficient synchronization is necessary for performance and reliability. While semaphores, mutexes, and condition variables provide fundamental solutions, contemporary OS architectures demand advanced techniques. Below is a good to know list to understand the context with respect to state-of-art OS synchronization matters. Mutexes vs. Semaphores: We need to understand when to use… Continue reading OS Synchronization Mechanisms

C Codes

Case Conversion using Bitwise

Upper Case to Lower Case: Lower Case to Upper Case:

C Codes

Day Today Codes

Codes that could come handy everyday. The list will continue to grow. Here is the compilation: Day-Today Codes

General Discussions

BST Operations

Find the BST code with: Insertion Deletion Traversals (in, pre and post) Here: Github Link

General Discussions

Stack and Heap Memory

Stack Memory Heap Memory Memory allocated is in LIFO fashion No specific order. Is random. Allocation and de-allocation of memory is automatic Allocation and de-allocation of memory is manual Locality of reference is excellent Locality of reference is adequate Memory allocated is of fixed size and is not flexible Resizing is possible Space is efficiently… Continue reading Stack and Heap Memory

General Discussions

Singly/Doubly Linked Lists

Singly Linked List Doubly Linked List Node has data and next pointer Node has data and (next + previous) pointers Allows one way traversal of list Allows two way traversal of list Less memory per node More memory per node Can be used when memory needs to be saved and search is not required Can… Continue reading Singly/Doubly Linked Lists

General Discussions

Understanding Recursion

Consider the Factorial Function: Product of all the integers between 1 to n. n! = 1 if n= 0 n! = n* (n-1) * (n-2) * . . . * 1 if n > 0 To avoid the shorthand definition for n! We have to list a formula for n! for each values of n… Continue reading Understanding Recursion

General Discussions

Types of Pointers

Pointer: Pointer is a variable which holds the address of another variable NULL Pointer: A null pointer has a value reserved for indicating that the pointer does not refer to a valid object. It is pointer initialized to NULL value Void Pointer: are pointers pointing to data of no specific data type. The compiler will… Continue reading Types of Pointers

General Discussions

Pointers: Advantages and Disadvantages

Pointer Advantages: Support dynamic memory allocation Faster access of data We can access byte or word locations and the CPU registers directly The data in one function can be modified by other function by passing the address More than one value can be returned from a function through parameters using  pointers Mainly useful while processing… Continue reading Pointers: Advantages and Disadvantages