1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
g100num [7]
3 years ago
15

The L-exclusion problem is a variant of the starvation-free mutual exclusion problem. We make two changes: as many as L threads

may be in the critical section at the same time, and fewer than L threads might fail (by halting) in the critical section. An implementation must satisfy the following conditions:_____.
L-Exclusion: At any time, at most L threads are in the critical section.
L-Starvation-Freedom: As long as fewer than L threads are in the critical section, then some thread that wants to enter the critical section will eventually succeed (even if some threads in the critical section have halted).
Modify the n-process Bakery mutual exclusion algorithm to turn it into an L-exclusion algorithm. Do not consider atomic operations in your answer. You can provide a pseudo-code solution or written solution.
Computers and Technology
1 answer:
vladimir2022 [97]3 years ago
6 0

Answer:

The solution is as follows.

class LFilters implements Lock {

int[] lvl;

int[] vic;

public LFilters(int n, int l) {

lvl = new int[max(n-l+1,0)];

vic = new int[max(n-l+1,0)];

for (int i = 0; i < n-l+1; i++) {

lvl[i] = 0;

}

}

public void lock() {

int me = ThreadID.get();

for (int i = 1; i < n-l+1; i++) { // attempt level i

lvl[me] = i;

vic[i] = me;

// rotate while conflicts exist

int above = l+1;

while (above > l && vic[i] == me) {

above = 0;

for (int k = 0; k < n; k++) {

if (lvl[k] >= i) above++;

}

}

}

}

public void unlock() {

int me = ThreadID.get();

lvl[me] = 0;

}

}

Explanation:

The code is presented above in which the a class is formed which has two variables, lvl and vic. It performs the operation of lock as indicated above.

You might be interested in
Write the technical terms for the following statements: The repeated working capacity of computer.
ozzi

The technical terms for the statement "The repeatedly working capacity of computer" is  known to be "diligence.

<h3>Why is the working capacity of computer" known to be "diligence."?</h3>

The capacity of a computer is known to be one that carry out or performs a lot of task in a repetitive manner without getting tired and as such, one can say the computer is diligent.

Note therefore that The technical terms for the statement "The repeatedly working capacity of computer" is  known to be "diligence.

Learn more about computer from

brainly.com/question/24540334

#SPJ1

8 0
2 years ago
Drag the correct type of update to its definition.
Sophie [7]

Answer:

  • PRI

The connection between a mobile device and radio tower.

  • Baseband

The chip that control the radio frequency waves within a device.

  • PRL

A list of radio frequencies.

Baseband can be defined as a  technology within the the mobile devices that creates and manages interface to wireless network such as radio transmitters and the radio receivers.

Primary Rate Interference PRI on the other hand is a connection that is configured by many countries. This configuration has specified data and control channels with specified speed for specified countries depending upon the T-carriers and E-carriers.

3 0
3 years ago
You have four DCs in your domain. Active Directory appears to be corrupted on one of the DCs, and you suspect a failing hard dri
Softa [21]

Answer:C

Explanation:

5 0
3 years ago
Let x = ["Red", 2.55,"Green", 3,"Black","false"], then solve the following:
blagie [28]

Answer:

  • Print(x) would be directly calling the x variable so it would print everything but the []
  • Print(x[10]) is calling the number 10 which results in E
  • 2 + d= 2d

3 0
3 years ago
Practising some questions for board exams for class 12 python,pls help with detailed answer
poizon [28]
I do t know the answer to this but i think tou can firger it iut food luck
3 0
3 years ago
Other questions:
  • How do type declaration statements for simple variables affect the readability of a language, considering that some languages do
    10·1 answer
  • Which translator program reads small portions of a program at a time, translating them into machine instructions which are then
    12·1 answer
  • Which of the following is true of property?
    13·1 answer
  • Today, air travel allows large numbers of people to move quickly over long distances. Which of the following is a likely effect
    8·1 answer
  • What is the pen tools use in Photoshop?
    6·2 answers
  • While in an interactive nslookup session, you'd use the ______ keyword to change the DNS server you're using
    5·2 answers
  • Suppose that a system uses 32-bit memory words and its memory is built from 16 1M × 16 RAM chips. How large, in words, is the me
    11·1 answer
  • 1 Point
    14·1 answer
  • Yeah help me please......................
    9·1 answer
  • Why media is far from government​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!