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
It needs to be as simple as possible. Each question is slightly different.1. An arithmetic progression is a sequence of numbers
madam [21]

Answer

can we get a picture of the problem ?

Explanation:

4 0
3 years ago
1. What are the advantages and disadvantages of technology in communication?
Gennadij [26K]

Answer:

ADVANTAGES:

First, the evolution of technology is beneficial to humans for several reasons. At the medical level, technology can help treat more sick people and consequently save many lives and combat very harmful viruses and bacteria.

2-Technology has also increased the productivity of almost every industry in the world. Thanks to technology, we can even pay with bitcoins instead of using banks

DISADVANTAGES:

1-Lack of Privacy. You might think that a quick text or IM offers more privacy than a telephone call in a crowded room. ...

2-Distraction from Real Life. ...

3-Potential for Misunderstanding. ...

4-Decline of Grammar and Spelling...

5- Near people are far and far people are near through communication technology. we have no time to sit with our relatives but constantly communicate far away people . I think this is biggest <em>disadvantage </em>

Explanation:

7 0
3 years ago
Read 2 more answers
Please help! Game design!
kvasek [131]

Answer:

player vs anonymous players

4 0
3 years ago
In powerpoint, what is line thickness measured in?
katrin [286]
Impasto. Hope this helps!
5 0
3 years ago
Which statement describes a printer driver? a) It is the configuration code that is sent to a printer to identify the operating
White raven [17]

Answer:

Option (b) is the correct and suitable answer for the above question.

Explanation:

The printer is a hardware which is used to convert the soft copy of an information to a printed copy (Hard copy) of information.

To use printer hardware a computer system needs a printer driver which is used to do the conversion from soft copy to a hard copy. Hardware printer uses only for the purpose to print the copy.

The option b says that the printer driver is used to convert the document into the form of that document which the printer can understand easily. It means conversion from soft copy to hard copy. Hence it is the right option.

The reason behind the other option which is not valid because--

Option a says that the printer driver is a code but it is a software.

Option c says that the printer driver is an interface but it is a software.

Option d says that the printer driver is a cache but it is a software.

4 0
3 years ago
Other questions:
  • Databases can have various objects some of which are tables, queries, forms or views, and reports objects. Each of these has fie
    14·1 answer
  • What does this sign mean?
    5·2 answers
  • Life Decisions Cyber Cafe is a cafe with free Internet service and computers that are linked to various online career opportunit
    15·1 answer
  • You load an image file into a numpy array and look at its shape, which is (433, 650). What does this indicate?
    13·1 answer
  • Explain the different features available in Print command?
    10·1 answer
  • Paul is a baker who wants to improve his recipe for muffins because they turn out with a greasy flavor. What ingredient should h
    14·1 answer
  • Raina remembered when she taught Amara to draw. What happened?
    6·1 answer
  • Fun with Characters
    7·1 answer
  • computer have taken over a lot of boring, repetitive and time consuming as well as dangerous jobs.true or false
    7·1 answer
  • Which privacy protection uses four colors to indicate the expected sharing limitations that are to be applied by recipients of t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!