0% found this document useful (0 votes)
29 views

OSY Q.2 Starvation and RAID Levels Answers

Uploaded by

sayalimane216
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

OSY Q.2 Starvation and RAID Levels Answers

Uploaded by

sayalimane216
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

2. What is Starvation? What is the solution for it?

Ans.

Starvation:

Starvation or indefinite blocking is a phenomenon associated with the Priority scheduling


algorithms, in which a process ready for the CPU (resources) can wait to run indefinitely
because of low priority. In a heavily loaded computer system, a steady stream of higher-
priority processes can prevent a low-priority process from ever getting the CPU.

Starvation in an operating system occurs when a process is perpetually denied the


resources it needs to progress, usually because other processes continually receive
priority access to those resources. This can happen in scheduling and resource allocation,
particularly in environments where some processes have higher priority than others. In
such cases, low-priority processes might wait indefinitely, resulting in starvation.

Solution for Starvation :

1. Aging:

Aging is a common method where the priority of a process increases the longer it waits.
This ensures that even low-priority processes eventually receive high enough priority to get
scheduled.

2. Fair Scheduling Algorithms:

Algorithms like Round Robin ensure every process gets a turn with the CPU, thus avoiding
starvation.

Fair-Share Scheduling allocates resources based on the fair distribution rather than fixed
priority.

3. Resource Allocation Techniques:

Banker’s Algorithm and similar techniques help manage resources in a way that avoids
long waits and starvation.

4. Deadlock Prevention Mechanisms:

Some starvation cases are linked to deadlock scenarios, where deadlock prevention
methods (e.g., preventing circular wait) can also help avoid starvation.
3. Explain various RAID LEVELS with its advantages and disadvantages.

Ans.

RAID 0: Striping

RAID 0, also known as a striped set or a striped volume, requires a minimum of two disks.
The disks are merged into a single large volume where data is stored evenly across the
number of disks in the array.

This process is called disk striping and involves splitting data into blocks and writing it
simultaneously/sequentially on multiple disks. Configuring the striped disks as a single
partition increases performance since multiple disks do reading and writing operations
simultaneously. Therefore, RAID 0 is generally implemented to improve speed and
efficiency.

Advantages of RAID 0

Cost-efficient and straightforward to implement.

Increased read and write performance.

No overhead (total capacity use).


Disadvantages of RAID 0

Doesn’t provide fault tolerance or redundancy.

RAID 1: Mirroring
RAID 1 is an array consisting of at least two disks where the same data is stored on
each to ensure redundancy. The most common use of RAID 1 is setting up a mirrored
pair consisting of two disks in which the contents of the first disk is mirrored in the
second. This is why such a configuration is also called mirroring.

Unlike with RAID 0, where the focus is solely on speed and performance, the primary
goal of RAID 1 is to provide redundancy. It eliminates the possibility of data loss and
downtime by replacing a failed drive with its replica.

Advantages of RAID 1

• Increased read performance.


• Provides redundancy and fault tolerance.
• Simple to configure and easy to use.

Disadvantages of RAID 1
• Uses only half of the storage capacity.
• More expensive (needs twice as many drivers).
• Requires powering down your computer to replace failed drive.

Raid 2: Bit-Level Striping with


Dedicated Hamming-Code Parity
RAID 2 is rarely used in practice today. It combines bit-level striping with error checking
and information correction. This RAID implementation requires two groups of disks –
one for writing the data and another for writing error correction codes. RAID 2 also
requires a special controller for the synchronized spinning of all disks.

Instead of data blocks, RAID 2 stripes data at the bit level across multiple disks.
Additionally, it uses the Humming error ode correction (ECC) and stores this information
on the redundancy disk.

Advantages of RAID 2

• Reliability.
• The ability to correct stored information.
Disadvantages of RAID 2

• Expensive.
• Difficult to implement.
• Require entire disks for ECC.

Raid 3: Bit-Level Striping with


Dedicated Parity
Like RAID 2, RAID 3 is rarely used in practice. This RAID implementation utilizes bit-level
striping and a dedicated parity disk. Because of this, it requires at least three drives,
where two are used for storing data strips, and one is used for parity.

To allow synchronized spinning, RAID 3 also needs a special controller. Due to its
configuration and synchronized disk spinning, it achieves better performance rates with
sequential operations than random read/write operations.

Advantages of RAID 3

• Good throughput when transferring large amounts of data.


• High efficiency with sequential operations.
• Disk failure resiliency.
Disadvantages of RAID 3

• Not suitable for transferring small files.


• Complex to implement.
• Difficult to set up as software RAID.

Raid 4: Block-Level Striping with


Dedicated Parity
RAID 4 is another unpopular standard RAID level. It consists of block-level data striping
across two or more independent diss and a dedicated parity disk.

The implementation requires at least three disks – two for storing data strips and one
dedicated for storing parity and providing redundancy. As each disk is independent and
there is no synchronized spinning, there is no need for a controller.

RAID 4 configuration is prone to bottlenecks when storing parity bits for each data block
on a single drive. Such system bottlenecks have a large impact on system performance.

Advantages of RAID 4

• Fast read operations.


• Low storage overhead.
• Simultaneous I/O requests.

Disadvantages of RAID 4
• Bottlenecks that have big effect on overall performance.
• Slow write operations.
• Redundancy is lost if the parity disk fails.

Raid 5: Striping with Parity


RAID 5 is considered the most secure and most common RAID implementation. It
combines striping and parity to provide a fast and reliable setup. Such a configuration
gives the user storage usability as with RAID 1 and the performance efficiency of RAID
0.

This RAID level consists of at least three hard drives (and at most, 16). Data is divided
into data strips and distributed across different disks in the array. This allows for high
performance rates due to fast read data transactions which can be done
simultaneously by different drives in the array.

Parity bits are distributed evenly on all disks after each sequence of data has been
saved. This feature ensures that you still have access to the data from parity bits in
case of a failed drive. Therefore, RAID 5 provides redundancy through parity bits instead
of mirroring.
Advantages of RAID 5

• High performance and capacity.


• Fast and reliable read speed.
• Tolerates single drive failure.

Disadvantages of RAID 5

• Longer rebuild time.


• Uses half of the storage capacity (due to parity).
• If more than one disk fails, data is lost.
• More complex to implement.

Raid 6: Striping with Double Parity


RAID 6 is an array similar to RAID 5 with an addition of its double parity feature. For this
reason, it is also referred to as the double-parity RAID.

This setup requires a minimum of four drives. The setup resembles RAID 5 but includes
two additional parity blocks distributed across the disk. Therefore, it uses block-level
striping to distribute the data across the array and stores two parity blocks for each
data block.
Block-level striping with two parity blocks allows two disk failures before any data is
lost. This means that in an event where two disks fail, RAID can still reconstruct the
required data.

Its performance depends on how the array is implemented, as well as the total number
of drives. Write operations are slower compared to other configurations due to its
double parity feature.

Advantages of RAID 6
• High fault and drive-failure tolerance.
• Storage efficiency (when more than four drives are used).
• Fast read operations.

Disadvantages of RAID 6
• Rebuild time can take up to 24 hours.
• Slow write performance.
• Complex to implement.
• More expensive.

You might also like