Determine the correctness of the algorithm

Assignment Help Data Structure & Algorithms
Reference no: EM131840769

1. Check the conditions for concurrent processing (mutual exclusion, deadlock avoidance, and starvation avoidance) for the following modifications of Petersen's algorithm; if any condition if violated, show the steps leading to this violation:

A.
Pi()
while (true)
wantsIn[i) = true;
turn = i; // instead of j
while (wantsIn[j) && turn == j ) ;
critical section;
wantsIn[i) = false;

B.
Pi()
while (true)
wantsIn[i] = true;
turn = i;  // instead of j
while (wantsIn[j] && turn = = i;   // instead of j

critical section;

wantsIn[i] = false; i);

2. Determine the correctness of the following algorithm; if it is incorrect, show an example in which one of conditions for the critical-section problem is violated. Two processes Po and PI share the following variables:

Two processes Po and PI share the following variables:
boolean wantsIn[2] = {false, false};
int turn;
here is the code for process Pi, i = 0 or 1, and j = 0 or 1 (i.e., j = 1 - i).
Pi ( )
while (true)
wantsIn(i] = true;
while (turn == j)
while (wantsIn[j]);
turn = i;
critical section;
wantsIn[i] = false;

Reference no: EM131840769

Questions Cloud

Credit card application from shady banks savings : You receive a credit card application from Shady Banks Savings and Loan offering an introductory rate of 3.5 percent per year,
Find the year zero cash flow : Spend 100000 on Machine C. You will need 5000 more in net working capital. Find the year zero cash flow. Find the total CF for each year.
Why would anyone want to murder martin luther king : How was the exercise that Elliott designed a response to the children's question, Why would anyone want to murder Martin Luther King?
Call option value using the two-sate stock price method : calculate your estimate of the call option's value using the two-sate stock price method.
Determine the correctness of the algorithm : Determine the correctness of the algorithm; if it is incorrect, show an example in which one of conditions for the critical-section problem
Internet browsing history : This can be clothes, a bedroom, a written essay, contents in a backpack, a car interior, music playlists, an Internet browsing history, and so on.
Build manpower planner for electrical engineering department : As a start, you were requested to build a Manpower Planner for the Electrical Engineering Department, particularly for its Diploma Program
Coupon rate that is greater than its yield to maturity : A bond with several years to maturity has a coupon rate that is greater than its yield to maturity. The bond will:
Write a one to two page faq sheet for the intended audience : Write a one to two page FAQ sheet for the intended audience and purpose. On a separate page within the same document.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd