×

Bit Vector in Operating System

What is Bit vector?

Bit vector is one of the most important methods used in the free space management of operating system. Free space management which is used by the operating system leads the free space in the hard disk that’s why we call it free space management. OS generally leads a free space list to keep the track of free space disk. Free space list contains all disk blocks which are not allocated to any file or directory.

Bit vector in Operating System

What is Bit?

Bit is also known as unit of information used in computing which can have only one of two values either 1 or 0.

Bit vector also known as bitmap is generally used to implement the free space list. In this method, every block symbolizes of a bit (0 or 1). Condition 1, when a block has bit 0 means block is allocated. Condition 2, when block have 1 bit which means block is free or no memory allocation. It refers to the special type of indexing which use bitmaps. This method is generally used for big databases.

  1. A bit vector size is identical to the number of disks blocks is used.
  2. If ith block is free then the bit vector value at ith location will be 0, otherwise 1.
  3. Memory requirements for storing the bit vectors also increase with the increase in size of the disk.

Advantages of Bit vector

Advantages of bit vector are as follows:

  1. It is simple and easy to understand.
  2. It consumes less memory.
  3. It is well organized to find free spaces.

Disadvantages of Bit vector

Disadvantages of bit vector are as follows:

  1. OS goes through all the blocks until it finds a free block.
  2. To find free block, OS may need to search the whole bit vector.
  3. It requires some special hardware support in some conditions.

Need of Bitmap

Now, we take an example to explain the working of bitmap. Assume that there is a company which holds an employee table with entries like empno, empname, designation, income etc. As we all know employees in any organization are hired once in a year which means the table is less updated and endure static most of the time. But the columns will always concurrent used in queries to retrieve data like: no of female candidates in the company and many more. In this situation, we need a method which is known as a file organization method which is capable enough to provide quick results. But any of the traditional file organization method is not that fast to provide quick results. Therefore, we switch better method of storing and retrieving data known as bitmap indexing.

Applications

The bitmap has number of applications in areas where the space as well as the efficiency is at premium. Most commonly, they are used to represent a simple group of Boolean flags or an ordered sequence of Boolean values.

  1. They are used for the priority queues, where the bit at index k is set if and only if k is in the queue.
  2. They are also used for the allocation of memory pages, disk sectors etc. In such cases term bitmap may also use. This term is generally used to refer to raster images which use multiple bit or pixel.
  3. Bloom filter which is one of the most important type of application of bitmaps. It is used to store the huge sets in small space in exchange for a small probability. It is also possible to build probabilistic hash tables based on bit arrays which accepts false positive or negatives.
  4. They are also a useful abstraction for examining the streams of compressed data, which often contain element that occupy portions of bytes or are not byte aligned, for example the compressed human coding representation of a single 8-bit character can be anywhere from 1 to 255 bits along.
  5. Bit maps and operations on them are also important for developing the succinct data structures, which is close to the minimum amount applicable space. In this context, operations like searching the nth bit up to the certain position become important.

Related Topics

Disk Scheduling Algorithms

Disk Scheduling Algorithms Disk scheduling algorithms are the algorithms that are used for scheduling a disk. Generally, the scheduling refers to a time-table for completing any task or a job. With the help...

2 minutes read.

Turn Variable or Strict Alternative Approach

Turn Variable or Strict Alternative Approach Turn Variable Approach is used for process synchronization mechanism, which offers synchronization between two processes. Turn variable is implemented on user mode, and it is a software mechanism. We...

3 minutes read.

Ubuntu Operating System

Ubuntu Operating System Ubuntu is an open-source and a Linux based operating system. Ubuntu is developed for the Network Servers, Computers, and Smartphones. The Ubuntu operating system was developed by Canonical...

3 minutes read.

Priority Scheduling in OS

Priority Scheduling is a type of CPU Scheduling algorithm which is used for process scheduling. In Priority Scheduling, we assign some priorities to each process. The process which has higher priority among all...

5 minutes read.

Thrashing in Operating System

A virtual memory system's poor performance when the same pages are loaded repeatedly due to a lack of main memory to store them in secondary memory is referred to as...

3 minutes read.

Operating System Tutorial

What is an Operating System? An Operating System is a System Software that handles the resources of a computer such as computer hardware and software and offers frequent services to the...

7 minutes read.

SCAN Disk Scheduling Algorithm

SCAN Disk Scheduling Algorithm The SCAN disk scheduling algorithm is another type of disk scheduling algorithm. In this algorithm, we move the disk arm into a specific direction (direction can be moved towards...

4 minutes read.

Simple Structure in Operating System

An operating system is a piece of software that lets the user applications talk to the hardware of the system. Because it is such a complicated structure, the operating system...

3 minutes read.

How to implement Monitors using Semaphores

Monitors Monitor is a type of synchronization device designed to solve difficulties caused by semaphores, such as timing errors. Monitors are the type of data types that are abstract by nature...

2 minutes read.

Look Disk Scheduling

Look Disk Scheduling Look disk scheduling is another type of disk scheduling algorithm. Look scheduling is an enhanced version of SCAN disk scheduling. Look disk scheduling is the same as SCAN disk scheduling,...

4 minutes read.

Dining Philosophers Problem in Operating System

Edsger Wybe Dijkstra was a well-known Dutch scientist. He was the first person ever to present the Dining Philosophers Problem in the stream of Computer Science. The dining philosophers problem...

5 minutes read.

Need of Operating System

There are various needs of operating system: Managing Input-Output UnitThe Operating system as a platform for application programsMultitaskingConsistent user interface Managing Input-Output Unit: - With the help of the operating system, the...

2 minutes read.

Deadlock Prevention in Operating System

Deadlock Prevention The conditions which we used for deadlock prevention are: Mutual ExclusionHold and WaitNo PreemptionCircular Wait 1. Mutual Exclusion: - From the resource point of view, the mutual exclusion means that simultaneously more...

4 minutes read.

Kernel in OS

What is Kernel in OS? The kernel is the core component in the operating system. The job of the kernel is to handle the communication between the hardware and the software. ...

2 minutes read.

Single-User Operating System

An operating system designed and intended to be used on a computer or device with a single user at a time is known as a single-user operating system. Devices like...

8 minutes read.

Feedback Queue in Operating System

In a computer or a laptop, there is a processor which do all the tasks. The processor cannot do all the tasks at a time. So, the tasks will be...

3 minutes read.

Virtual Memory in Operating System

What is Virtual Memory Virtual Memory is a storage scheme in which the users have an illusion that users have a significant amount of Main Memory. We can perform this by taking a...

3 minutes read.

Booting Process in Operating System

What is Booting? Booting is defined as the term which says that the process of loading the operating system into the memory. The process of booting begins when we switch on...

4 minutes read.

Process State in OS

The Process passes from different states, from its formation to completion. The following are the states of the Process. NewReadyRunningBlock or WaitTerminated or CompletedSuspend readySuspend wait or suspend blocked 1. New: - The state in which a process...

2 minutes read.

Trap vs Interrupt in Operating System

What is Trap in Operating System? A trap is a synchronous interrupt used to perform functionality when an error occurs in a user process. A trap in an operating system can...

4 minutes read.