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
Which of the following code displays the area of a circle if the radius is positive? Question 4 options: if (radius &lt;= 0) Sys
Marina CMI [18]

Answer:

(d) if (radius > 0) System.out.println(radius * radius * 3.14159);

Explanation:

Given

Code segment (a) to (d)

Required

Which is correct

Code segment (a): radius <=0

This means that radius is 0 or less, i.e. 0 or negative

Code segment (b): radius !=0

This means that radius is not equal to 0 i.e. it could be positive or negative but definitely not 0

Code segment (c): radius >=0

This means that radius is 0 or greater, i.e. 0 or positive

Code segment (d): radius >0

This means that radius is  greater than 0 i.e. positive

<em>Hence, (d) is correct</em>

3 0
3 years ago
Select the standardized features of Windows that make it easier to manage your tools:
anygoal [31]

Answer: The Standardized feature of Windows that make it easier to manage tools are:

1. Toolbar

2. Menu

3. Taskbar

Explanation: 1. Toolbar helps to easily show the various tools that can be used on Windows.

2. Menu helps to separate the different parts of the Windows for easy access.

3. Taskbar helps to show the various tools for doing a task.

5 0
3 years ago
Is MOOC's potentially harmful to copyright? Why or why not ?
vladimir2022 [97]

Answer:

Fair-use exceptions to traditional copyright protection face challenges as well, given a MOOC's potential for global reach. Nonetheless, fair use and MOOCs are not mutually exclusive ideas. MOOCs remain an experiment...

5 0
3 years ago
The instructions for the OS provided by application software are known as _____.
Galina-37 [17]

Answer:

Pp

Explanation:

I like pp

7 0
3 years ago
Required skills,training,education for dentist
AlekseyPX

Answer:

Education-Bachelor's degree prior to admission to dental school; doctoral degree in dental medicine or dental surgery; some dental specializations require completion of a residency

Skills- Communication skills. Dentists must have excellent communication skills, Detail oriented, Dexterity, Leadership skills, Organizational skills, Patience, Physical stamina, Problem-solving skills.

Explanation:

7 0
3 years ago
Other questions:
  • When people need information, they typically turn to:
    7·1 answer
  • Grid computing is a type of computing in which:
    15·1 answer
  • Write a repetition statement that outputs the numbers 45 , 51 , . . . , 165 . That is, all of the multiples of 6 in increasing o
    7·1 answer
  • What are the methods of identifying publicly switched networks?
    14·1 answer
  • TWO QUICK QUESTIONS
    12·1 answer
  • What some one ask me if i am more of hardware or software person, what is that mean?
    6·1 answer
  • Individual internet users connect to isps through a(n ________.
    11·1 answer
  • Write a procedure named Read10 that reads exactly ten characters from standard input into an array of BYTE named myString. Use t
    15·1 answer
  • Type the correct answer in the box. Use numerals instead of words. If necessary, use / for the fraction bar. What will be the ou
    14·1 answer
  • Difine the term pigment​
    14·3 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!