Question #7
Solution:
These functions can also be applied for the non-critical section, but one must not do it.
Since, this leads to the wastage of time and takes longer execution of time.
The pseudo-code to demonstrate the working of the P() and V() functions are provided below:
//Program code
P(s);
//Area of Critical section.
//Provide the function V() for the other processes.
V(s);
//Remain code.
The waiting function P():-
P(s):
{
//The loop executes till infinite till the value of semaphore s become 0.
while(s == 0);
s = s – 1;
}
The waking up function V(s) is defined below:
V(s):
{
s = s + 1;
}
Question #8
Solution:
The potential problem of multi-programming is as follows:
Question #7 Generally, both P and V operation must be implemented as a critical section. Are...
Question 14 Generally, medical providers must obtain informed consent for any treatment. But some special conditions create an exception, so that informed consent is not needed for treatment. Which of the following conditions, on its own and without other special requirements, is sufficient to make such an exception? The patient has previously agreed to other treatments, and generally has done everything their medical providers have told them they needed to do. The treatment is widely accepted as normal, such as...
TRUE-FALSE Basic synchronization principles and multithreading 1. Java user threads can implement both busy-waiting and no-busy-waiting policy. 2. Priority inversion avoids deadlocks. 3. Spinlock mutex can be used as an adaptive mutex. 4. Java RTE can be blocked for Input/Output operation. 5. Interrupted user thread, which executes a method in a monitor, must be rolled back to undo any changes it performed. 6. The synchronization primitive by disabling interrupts can be used by an application program. 7. Bounded-waiting requirement is...
Section III of this assignment asks you to explain how finding the answer to your question might impact others around you. For instance, who might be most invested in the answer? Using your Asking Questions Chart, complete a short draft of Section III of your Project 3 submission for instructor feedback. This should be a short paragraph of three to four sentences. You may write your submission directly into the “Write Submission” textbox below. This activity is provided as a...
Patterson v. McLean Credit Union 491 U.S. 164 (1989) A black female alleged racial discrimination in violation of section 1981 in that she was treated differently from white employees and not promoted, on the basis of race. The Court held that section 1981 was not available to address this problem since the case did not involve the making of a contract, but rather its performance. Kennedy, J. *** Patterson, a black female, worked for the McLean Credit Union (MCU) as...
QUESTION 1: You are inserting a gene into an MCS found within the LacZ gene. Using blue/white colony selection, why could you assume that white colonies have modified plasmids? a. A blue colony means the LacZ reading-frame was disrupted b. A blue colony means your gene has mutations c. A white colony means the LacZ reading-frame is intact d. A white colony means the LacZ reading-frame was disrupted QUESTION 2: You are performing a PCR using primers with a sequence perfectly...
THOMAS DRAKE'S 2018 TAX SCENARIO Thomas Drake is a small business owner, operating a manufacturing plant in Chicago, Illinois (as an S-Corp.) He has heard about a new tax break called Section 199A (deduction for qualified business income) wherein he may be entitled to a deduction of up to 20% of his qualified business income. If he can qualify for this deduction, it would result in significant tax savings for his business. Consequently, he contacts your accounting firm to find...
Multiple Choice Multiple Choice Section 3.1 The Bag ADT For the bag class in Chapter 3 (using a fixed array and a typedef statement) what steps were necessary for changing from a bag of integers to a bag of double values? A. Change the array declaration from int data[CAPACITY] to double data[CAPACITY] and recompile. B. Change the int to double in the typedef statement and recompile. C. Round each double value to an integer before putting it in the bag....
operating system engineering , please read the question and solve on the given skeleton code . Write a multi-threaded program with Semaphores as counters and pthread_mutex_t mutex to solve the producer-consumer problem: A bounded buffer is simply a global integer array of size N (2) which can be accessed by multiple threads. • Create two types of threads - Producer (2) and Consumer (2). Producers will write to the buffer, and the consumers will read the buffer. In this scenario,...
In Problem Set 7 you designed and implemented a Message class. This time, let's design and implement a Mailbox class in a file named Mailbox java. Do the following with this class • You may use the Message class from PS 7. You will have to add new features to the Message class from PS 7 as you work through this problem. You are welcome to start with my sample solution if you wish • Suppose there are multiple mail...
Give an specific example and describe the operation of a perpetual motion machine. Will the machine work? Why or why not? Reply to the posts of at least two other students as well as comments on your own post. 13 Use the Everyday Phenomenon Box 11.2 on page 230 of the textbook as an example. Do not post this as your example, however. Everyday Phenomenon Box 11.2 Water turbine O n A Productive Pond The Situation. A local farmer consulted...