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]
2 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]2 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
A label control's __________ property determines whether the control automatically sizes to fit its current contents.
Kazeer [188]

Answer:

Option d (Auto Size) is the correct answer.

Explanation:

In a C# programming language, when a user needs to create a Windows Forms Label, then he needs to specify the property of label that how the label will look like and where the label fits and what is the size of that label. Following are the property which has a different meaning and a user need to specify when he creates a label--

  1. Fit states that the label to fix in the size.
  2. Text align states that the item of the toolbar is fixed in the center.
  3. The Middle center states that the item is fixed in the middle.
  4. Auto Size helps that the size of the control can be automatically resized.

The above question asked about that property which is used to automatically resize the control. So the answer is Auto size which is described above. Hence Option d is the correct answer while the other is not because--

  • Option a state about 'Fit' property which is used to fix the label size.
  • Option b states about 'Text align' property which is used to fix items of the toolbar in the center.
  • Option c states about 'Middle center' property which is used to fix the item in the middle.
4 0
2 years ago
Complete the paragraph to explain how Angelina can notify readers that her report is just a draft.
iogann1982 [59]

Answer:

Background

Design

Page background

Custom

Explanation:

5 0
3 years ago
Henry must choose which type of smart speaker to use in his home. He asked you to help him decide which one will best suit his n
ch4aika [34]

Answer:

(B) Home

Explanation:

Echo is an Amazon product.

Home is a smart speaker developed by Google.  

Cortana is a product of Microsoft.

HomePod is developed by Apple.

If Henry wants to be connected to his Google account, you would recommend him to buy Home, because it is a Google product.

4 0
3 years ago
Whenever I ask a question I loose points I just asked a question before and I had 56 points now I have 12 now I'll probably have
lilavasa [31]
Just try to answer some questions as well, then you can keep a nice balance.
ps. Only answer the questions you know. 
5 0
2 years ago
Question 1
weeeeeb [17]

Answer:

-6.4

Explanation:

just divide -32 by 5 and you will get your answer of -6.4

7 0
2 years ago
Other questions:
  • Write an expression that evaluates to true if and only if the value of the integer variable workedOvertime is true.
    7·1 answer
  • What is the maximum input current fr transformer T10266
    10·1 answer
  • The mathematical constant Pi is an irrational number with value approximately 3.1415928... The precise value of this constant ca
    12·1 answer
  • You are purchasing several PC systems that will be used as thin clients in a large organization. Which hardware selection criter
    9·1 answer
  • Write a program that lets a maker of chips and salsa keep track of sales for five different types of salsa: mild, medium, sweet,
    14·1 answer
  • 01110101<br> +00100100<br> 00010001
    8·1 answer
  • Which is the correct notation to specify the following inheritance?
    8·1 answer
  • define the term computer hardware and its various types mentioning 5 examples of IP or devices with one diagram each​
    9·1 answer
  • Consider the method get Hours, which is intended to calculate the number of hours that a vehicle takes to travel between two mil
    6·1 answer
  • Suppose we used an internet addressing protocol that used 4 bits to encode a single address. How many devices would be supported
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!