Posts

Sorting Algorithms In Brief

This article is a brief description of some set of widely used sorting techniques and it's implementations in golang . Summary: Insertion Sort Selection Sort Insertion Sort This algorithm maintains a sorted portion and unsorted portion, in the given list of elements to be sorted. It picks a corner element from unsorted portion and inserts it into correct location in the sorted portion. Here is the golang implementation of insertion sort. Run in Go Playground Here the algorithm sorts the elements in ascending order. The outer for loop, scan the array from start to end. ( with itr iterator.) The left portion pointed by outer for loop iterator will be the sorted portion. On every iteration of outer for loop, inner for loop shift the element pointed by outer iterator to its correct locations. This has been achieved by continuous comparison ( arr[inItr] ) and swapping. Selection Sort Similar to insertion sort, selection sort ...

Question and Answers

What is RR scheduling algorithm? A interpretation based on common situations in life. What is a system call in operating systems? | Home |

What is RR scheduling algorithm? A interpretation based on common situations in life

Where ever you go, you can find people in queue to get something processed, either it is airports for getting documents verified or even at hospitals to see a eminent doctor. People feels boring not only because of processor does not completes execution of their processor but also because of if processor does not even look into their processing need over a constant interval to satisfy their thirst of getting a touch by processor over intervals [ known as starvation ]. Round robin schedules every running processes on main memory for execution for a specific quantum of time and preempts the execution process to give chance for the next, hence gives a lesser starvation. By adjusting lesser time time quantum the efficiency of execution also get increased. For detailed reading refer : Operating Systems | Scheduling Algorithms : Round Robin | Q/A Section | Home |

Computer Networks | what happens when you enter a URL? An introduction to Computer Networking

Image
Any data, information or even hardware which are shareable among different computers are known as resources in computer network. Resource sharing is the major, reason for interconnecting different computing systems. Such a interconnected system of computers are known as network . Each computer in this interconnected group of computers is called a host computer . So a network can be termed as a group of interconnected hosts. Any work which is running on a system is called a process . In computer networking major focus is for processes which are participating in the resources sharing between host computers. example : A process sending URL GET get request from a Chrome browser. A web server is a machine which delivers resources related to content of website, as per the request by any other machine(clients) in the network. Both server and client machine are hosts of a same network or different networks. A URL like http://www.wikipedia.org/wiki/Main_Pa...

What is a system call in operating systems?

CPU executes a program either in USER MODE or KERNEL MODE. Most of the Kernel Mode processes will be, basic level core functionalities of system and such processes will have direct accesess to most of the available resources of the system. Most of the User Mode processes will be of third party programs, which may be hazardes to a computet if we give direct access to resources. So for a program running in user mode must have to uses Operating System APIs inorders to access resources with out any security breaches. For such accesess the process in User Mode have to call OS functions with APIs provided, is known as system calls . What is RR scheduling algorithm? A interpretation based on common situations in life | Q/A Section | Home |

Operating Systems | Lock Variable Synchronization Mechanism

Image
To learn lock variable synchronization mechanism, you have to understand different modes of execution of instructions in an operating system. Basically there are two modes of execution in a system, User Mode and Kernel Mode. The unrestricted access to any resources in the system, for executing instructions in Kernel Mode makes resources available only for most trusted basic level functions of operating system . Direct access of hardware or memory references are not allowed in User Mode , due security concerns over higher level applications. System APIs provide a path way to reference these resources. Features of Lock Variable A software logic implemented in User Mode. A Busy waiting method of synchronization. Multiple processes can be handled by single mechanism. There are two basic section for every synchronization method, which decides the nature of that algorithm, Entry and Exit sections. Arranged as shown. Here in lo...

Operating Systems | Properties of Synchronization Mechanisms

Image
Necessary conditions to consider a synchronization method as reliable. Mutual Exclusion Progress Properties which will enhance the efficiency of synchronization mechanisms. Bounded Waiting Portability Mutual Exclusion Mutual exclusion is a property, that provides an isolation between processes from accessing critical resources simultaneously. A process, that is using shared resources for execution of critical section, will prevent other programs from accessing the same resources with the help of synchronization mechanisms. Progress If selection of a process from processes , that are ready to accesses certain shared resource, get decided within a limit of time, means there is a progress in work with the method used for synchronization. An infinite decision time show lack of progress. Bounded Waiting There exist a bound or a limit, if it is possible to c...