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 function that receives a StaticArray and returns an integer that describes whether the array is sorted. The method must
koban [17]

Answer:

is_sorted(arr: StaticArray) -&gt; int: Write a function that receives a StaticArray and returns an integer that describes whether the array is sorted. The method must return: 1

Explanation:

4 0
2 years ago
An online conference room reservation system lets a user reserve rooms. The user is required to enter contact information and re
lisov135 [29]

Answer:b)Reserve Room, Enter Contact Information, Enter Reservation Detail

Explanation: The use case is described as actors , actors goal, usage of use cases, units of scope and initial point and terminating point of use cases .

The situation mentioned in the question will take place for the reservation of the room through the instances in the form like filling the contact details for the identification , filling out reservation information as well for getting the knowledge about the room requirement by the person.

These details help in reaching out the particular person if required, number of days he wants to book the room,any extra facility he would like to have etc. After these detail filling activity the room can be reserved successfully.Thus , the most appropriate option is option (b).

Other options are incorrect because room reservation cannot be done without any formality as mentioned in the question and entering contact detail and reservation detail one by one.

7 0
3 years ago
A sequence of repetitive operations performed to evaluate the ability of a PC to operate at peak efficiency for a defined time p
iragen [17]

Answer:

False.

Explanation:

The description provided matches better with Software performance testing, and shouldn't be confused with a benchmark.

In computing, a benchmark is a tool or software designed to measure the average performance of another program, by running several tests and trials against it.

A performance testing is designed to measure the performance and responsiveness of a computer system (not a program) under a heavy workload.

8 0
4 years ago
For the Address Block 195.200.0.0/16 a. If you have 320 Customers that need 128 addresses/customer - will there be enough addres
Shkiper50 [21]

Answer / Explanation:

195.200.0.0/16

Note: Class C address can not be assigned a subnet mask of /16 because class c address has 24 bits assigned for network part.

2ⁿ = number of subnets

where n is additional bits borrowed from the host portion.

2ˣ - 2 = number of hosts

where x represent bits for the host portion.

Assuming we have 195.200.0.0/25

In the last octet, we have one bit for the network

number of subnets  = 2¹  =2 network addresses  

number of host = 2⁷ - 2= 126 network addresses per subnets

8 0
3 years ago
Explain two consequences that would occur, if the "Device Manager and the "File Managerstopped communicating with each other?
sladkih [1.3K]

Answer:

So, you won't be able to install driver via a file because device manager can't find it. Just reinstall windows if that happens lol.

4 0
3 years ago
Other questions:
  • Which us electronic company was the pioneer in home video game consoles?
    13·1 answer
  • What is the proper course of action for the following scenario? You want to expand a computer’s capability to play and process v
    8·1 answer
  • Please I need help with this !!!! <br> Complete the table given below.
    8·1 answer
  • On a camera,what does focus tracking do?
    6·1 answer
  • Write an algorithm that receives a number from the user (you can store the number in a variable called N). Then the algorithm sh
    8·1 answer
  • Administrators who are wary of using the same tools that attackers use should remember that a tool that can help close an open o
    6·1 answer
  • Hola soy nuevo alguien me dice como funciona cada tipo de internet osea mandenme imágenes de diferentes moden creo que ya saben
    11·1 answer
  • An organization is conducting a study to see if hazardous waste sites pose health risks for cancer or other conditions, such as
    12·1 answer
  • Gauthmath https://s.tutorus.xyz/lp/invite?code=GGQGBL​
    13·1 answer
  • What is the output of this program? age=4 if age &gt;5: print (“more”) else: print (“less”)
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!