Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that we have the simple task of writing some important information into two files on the disk. However, these files are shared by other

Assume that we have the simple task of writing some important information into two files on the disk. However, these files are shared by other programs as well. If we use the following strategy to update the files:

Lock A

Lock B

Write information to A and B

Release the locks

This coding can result in deadlocks if other tasks are also writing to these files. For example If another task locks B first, then locks A, and if both tasks try to do their job at the same time dead-lock occurs. Similarly Process A can wait for a lock held by task B which is waiting for a lock held by task C which is waiting for a lock held by task A. A circular wait result in deadlock. How this deadlock condition can be avoided. Write solution and pseudo-code of provided solution.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions