A.
Mutex:
A mutex delivers mutual exclusion to either producer or consumer may have the mutex (that is key) and continue with their works. The consumer need to wait until the producer fill the buffer and vice versa.
Semaphore:
A semaphore is the generalized mutex. It split the buffer into identical resources. The producer and the consumer may work on different buffers at the same time.
B.
Mutex:
A mutex delivers mutual exclusion to either producer or consumer may have the mutex (that is key) and continue with their works. The consumer needs to wait until the producer fill the buffer and vice versa.
Semaphore:
A semaphore is the generalized mutex. It split the buffer into identical resources. The producer and the consumer may work on different buffers at the same time.
C.
Mutex:
A mutex delivers mutual exclusion to either producer or consumer may have the mutex (that is key) and continue with their works. The consumer need to wait until the producer fill the buffer and vice versa.
Semaphore:
A semaphore is the generalized mutex. It split the buffer into identical resources. The producer and the consumer may work on different buffers at the same time.
Want to see the full answer?
Check out a sample textbook solutionChapter 12 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
- R-13.17 - There are eight small islands in a lake, and the state wants to build seven bridges to connect them so that each island can be reached from any other one via one or more bridges. The cost of constructing a bridge is proportional to its length. The distances between pairs of islands are given in the following table. Find which bridges to build to minimize the total construction cost.arrow_forwardProblem 1. Two DNA strands of length 100 (number of bases in the sequence) are given in DNA1.txt and DNA2.txt file. Find the longest common subsequence (LCS) between the two sequences using dynamic programming bottom-up (tabulation) approach. Submit your code to solve the problem. How much time (in seconds or milliseconds) is required by your computer to run the algorithm? Solve the same LCS problem using dynamic programming top-down (memorization) approach. Submit your code to solve the problem. How much time (in seconds or milliseconds) is required by your computer to run the algorithm. Which solution is faster and why? Discuss your solutions.arrow_forward3. Simplify the following Boolean functions, using four-variable Kmaps: (a) F (w, x, y, z) = Σ(1, 4, 5, 6, 12, 14, 15) (b) F (A, B, C, D) = Σ(2, 3, 6, 7, 12, 13, 14) (c) F (w, x, y, z) = Σ(1, 3, 4, 5, 6, 7, 9, 11, 13, 15)arrow_forward
- Q.) Do given c and d problem belowarrow_forwardProblem 10arrow_forward(Practice) a. Using Figure 2.14 and assuming the variable name rate is assigned to the byte at memory address 159, determine the addresses corresponding to each variable declared in the following statements. Also, fill in the correct number of bytes with the initialization data included in the declaration statements. (Use letters for the characters, not the computer codes that would actually be stored.) floatrate; charch1=M,ch2=E,ch3=L,ch4=T; doubletaxes; intnum,count=0; b. Repeat Exercise 9a, but substitute the actual byte patterns that a computer using the ASCII code would use to store characters in the variables ch1, ch2, ch3, and ch4. (Hint: Use Appendix B.)arrow_forward
- 21. Take a careful look at Fig. 6-11(b). If D asks for one more unit, does this lead to a safe state or an unsafe one? What if the request came from C instead of D?arrow_forward1. Develop a system of linear equations for the network by writing an equation for each router (A, B, C, D, and E). Make sure to write your final answer as Ax=b where A is the 5x5 coefficient matrix, x is the 5x1 vector of unknowns, and b is a 5x1 vector of constants. 2. construct the augmented matrix [A b] and then perform row reduction using the rref() function. Write out your reduced matrix and identify the free and basic variables of the system. 3. Use MATLAB to compute the LU decomposition of A, i.e., find A = LU. For this decomposition, find the transformed set of equations Ly = b, where y = Ux. Solve the system of equations Ly = b for the unknown vector y. 4. Compute the inverse of U using the inv() function. 5. Compute the solution to the original system of equations by transforming y into x, i.e., compute x = inv(U)y 6. Check your answer for x1 using Cramer’s Rule. Use MATLAB to compute the required determinants using the det() function.arrow_forwardAssume that the following are concurrent VHDL statements: (a) L <= P nand Q after 10 ns; (b) M <= L nor N after 5 ns; (c) R <= not M; Initially at time t = 0 ns, P = 1, Q = 1, and N = 0. If Q becomes 0 at time t = 4 ns, (1) At what time will statement (a) execute? (2) At what time will L be updated? (3) At what time will statement (c) execute? (4) At what time will R be updated?arrow_forward
- Question No.4: Process Synchronization. Consider the classical synchronization problem of dining philosophers in which, n philosophers sit at a round table with one chop stick between each philosopher (chop stick on the right hand belong to each philosopher). Philosophers do one work at a time i.e. either are thinking or eating. To eat, they need to have two chop sticks such that the chopsticks to their left and their right. a. Provide an algorithm using Test-and-Set logic (disabling interrupts) to solves the diningphilosopher problem. b. Show the steps of the solution validatingi) Mutual exclusion, ii) Progress, iii) Must be viable for any number of philosophers and ensure that none of them starves to death.arrow_forwardPlease provide solution for the following:arrow_forwardPlease answer Parts D and E of this problemarrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr