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 a program in qbasic to accept a character and check it is vowel or consonant​
Alborosie

Answer:

In sub procedure or normal program?

6 0
3 years ago
What is the correct order of the phases of the software development process?
Damm [24]
Known as the 'software development life cycle,' these six steps include planning, analysis, design, development & implementation, testing & deployment and maintenance. Let's study each of these steps to know how the perfect software is developed.
8 0
3 years ago
By generating and delivering timely and relevant information supported by networks, _____ creates new opportunities for conducti
castortr0y [4]

Answer:

The correct option to the following question is option (B). e-business.

Explanation:

E-business is stands for the Electronic business.

E-business is the business which is conduct by the uses of the internet, Web, extranet or intranet, etc.

E-business is also known as the online business where online transactions take place.

E-business facilitates our customers that the selling and the buying of the goods between the consumers and the merchants.

7 0
3 years ago
The challenge of preparing for ____________________ is in ensuring that employees do not feel that they are being prepared for t
Liula [17]

Answer:

"Cross-training " seems to be the right response.

Explanation:

  • Cross-training seems to be the method of constructing a multi-professional workers staff with incentive plans to make sure that they must have the same tools to complete different occupational tasks throughout the organization.
  • This will be a very broad approach besides randomized controlled training methods, both maximum and minimum frequency, for generations.
7 0
3 years ago
In an ipv4 address, what are the maximum number of bits that can be used to identify the network address
Solnce55 [7]
Up to 24 bits can be used to identify unique <span>networks.</span>
5 0
3 years ago
Other questions:
  • What does LMS Date Updated mean?
    9·1 answer
  • Select one of the following strategies: active listening, sandwich technique, constructive feedback. in 2-5 paragraphs, define a
    11·1 answer
  • You may nest while and do-while loops, but you may not nest for loops<br><br><br><br> True False
    10·1 answer
  • Given a variable temps that refers to a list, all of whose elements refer to values of type float, representing temperature data
    10·2 answers
  • What is the value of the average variable after the following code is executed? var sum = 0; var prices = [14, 10, 9, 12, 11, 14
    14·1 answer
  • A store owner keeps a record of daily transactions in a text file. Each line contains three items: The invoice number, the cash
    7·1 answer
  • You have been hired by a small company to install a backbone to connect four 100base-T Ethernet LANs (each using one 24-port hub
    12·1 answer
  • A binary search algorithm ____________ an ordered list in<br> half to find an item.
    13·1 answer
  • _______________________ variables do not need to be declared inside the function definition body, they get declared when the fun
    15·1 answer
  • The Baltimore Sun reported on a study by Dr. Sara Harkness in which she compared the sleep patterns of 6-month-old infants in th
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!