ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 8 Weeks Ago, 5 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 26 Apr 2017 My Price 8.00

S1 has a shared lock on D1, and S2

Please answer the 2 scenarios below (Scenario 11/12). I provided some context and examples on what i am looking for!

 

This assignment verifies that you understand how shared and exclusive locks work. Suppose that S1, S2, and S3 are sessions connected concurrently to the same database instance. Suppose further that D1, D2, and D3 are data objects that can be locked with a shared and exclusive lock.

 

Before you address each of the scenarios below, let us take a look at two examples.

 

Example 1: If S1 has a shared lock on D1, and S2 has a shared lock on D2, what would happen if S3 attempts to procure a shared lock on D1? The answer is that S3 would be granted the shared lock, because by the nature of a shared lock, it is acceptable for both S1 and S3 to have a shared lock on the same data item at the same time.

 

Example 2: If S1 has an exclusive lock on D1, and S2 has an exclusive lock on D2, what would happen if S3 attempts to procure a shared lock on D1? The answer is that S3 would need to wait until S1 releases the lock on D1, because by the nature of an exclusive lock, only one session at a time may have the lock. Therefore S3 cannot be granted the lock at the same time S1 has the lock, and S3 will need to wait until S1 releases the lock.

 

Now that we have taken a look at a couple of examples, it is your turn to describe what will happen in each scenario below. For each scenario, indicate, for each session, whether it procures the requested lock, waits, or deadlocks. Make sure to explain your reasoning.

 

Scenario 11: S1 has a shared lock on D1 and attempts to procure an exclusive lock on D2. S2 has a shared lock on D2 and attempts to procure an exclusive lock on D3. S3 has a shared lock on D3 and attempts to procure an exclusive lock on D1.

-

Scenario 12: S1 has a shared lock on D1 and attempts to procure a shared lock on D2. S2 has a shared lock on D2 and attempts to procure a shared lock on D3. S3 has a shared lock on D3 and attempts to procure an exclusive lock on D1.

Answers

(11)
Status NEW Posted 26 Apr 2017 12:04 AM My Price 8.00

-----------

Not Rated(0)