Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question: Linux provides a sys futex() system call to assist in implementing hybrid user-level/kernel-level locks and condition variables. A call to long sys futex(void *addr1, FUTEX WAIT, int val1, NULL, NULL, 0 checks to see if the memory at address addr1 has the same value as val1. If so, the calling thread is suspended. If not, the calling thread returns immediately with the error return value EWOULDBLOCK. In addition, the system call will return with the value EINTR if the threadreceives a signal. A call to long sys futex(void *addr1, FUTEX WAKE, 1, NULL, NULL, 0) causes one thread waiting on addr1 to return. Consider the following (too) simple implementation of a hybrid userlevel/kernel-level lock.

2185_Too.png

There are three problems with this code.

(a.) Peformance. The goal of this code is to avoid making (expensive) system calls in the uncontested case when an Acquire() tries to acquire a free lock or a Release() call releases a lock with no other waiting threads. This code fails to meet this goal. Why?

(b.) Performance. There is a subtle corner case when multiple threads try to acquire the lock at the same time that can show up as occasional slowdowns and bursts of CPU usage. What is the problem?

(c.) Correctness. There is a corner case that can cause the mutual exclusion correctness condition to be violated, allowing two threads to both believe they hold the lock. What is the problem?

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92285071
  • Price:- $45

Guranteed 36 Hours Delivery, In Price:- $45

Have any Question?


Related Questions in Computer Engineering

Question suppose you are given an instance of the

Question : Suppose you are given an instance of the fractional knapsack problem in which all the items have the same weight. Show that you can solve the fractional knapsack problem in this case in O(n) time.

List and describe the threats posted to information

List and describe the threats posted to information security and common attacks associated with those attacks

Question need two different postsresponses with 200 words

Question: Need two different posts(responses) with 200 words each on the below topic. 1. Develop a product service idea. A. Describe the product/service including the benefits of using the product/service B. Discuss the ...

student who is taking quizzes public class student

/** A student who is taking quizzes. */ public class Student { private String name; private double totalScore; private int quizCount; public Student (String n) { name = n; totalScore = 0; quizCount = 0; } public String g ...

Software engineering software architecture questioncan

(Software engineering (Software Architecture) question) Can someone explain how a system's decomposition into components is driven by the system's features/requirements. Also, how can this decomposition be used to determ ...

Question suppose that you have a set of n files that have

Question : Suppose that you have a set of n files that have to be copied on 1GB USB drives. You can assume that the file sizes are known and always less than or equal to 1GB. The objective is to use the minimum possible ...

Question superfast software inc was founded last year by

Question : Superfast Software Inc. was founded last year by three young programmers. They all dreamed their company would become a really big one and would distribute a large number of software products all over the worl ...

Case study 1 requirement analysis and gathering for the

Case Study 1: Requirement Analysis and Gathering for the State Firefighters Association Read the mini case on The State Firefighters Association located in Chapter 3 of the textbook and complete the assignment. Write a t ...

You want to be a millionaire when you retire in 35

You want to be a millionaire when you retire in 35 years. a. How much do you have to save each month if you can earn an annual return of 10.7 percent?  (Do not round intermediate calculations and round your answer to 2 d ...

Describe 2 variables a government will look at to predict

Describe 2 variables a government will look at to predict where the economy will be in the next six months.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As