Question

In: Computer Science

Which of the following statements about sharing data by threads is (are) correct? Select all that...

Which of the following statements about sharing data by threads is (are) correct? Select all that apply.

(a) When kernel-mode threads in a process share data, a race condition will not occur, since threads are managed operating systems.

(b) When kernel-mode threads in a process share data, a race condition can occur and therefore, a semaphore (or semaphores) should be used to prevent race conditions.

(c) When user-mode threads in a process share data, a race condition will not occur, since the thread scheduler in each process manages (schedules) threads.

(d) When user-mode threads in a process share data, a race condition can occur and therefore, a semaphore (or semaphores) should be used to prevent race conditions.

(e) None of the above.

Solutions

Expert Solution

First of all, the second option (b) and fourth option (d) both are same.  

The options (a) and (c) are wrong, because a race condition can or may always occur while threading. A race condition occurs inside a critical section. It happens as a result of difference in executing multiple threads inside a critical section to that of the order in which the thread executes. A critical section is one where the shared variables in a code can be accessed. nly one variable at a time can be accessed in critical section

So the correct option is (b). semaphores can be used to prevent race conditions. Semaphores signalling mechanism using wait and signal operation. Its a non negative variable. A thread that is waiting in it can be signalled by other threads.It uses wait and signal atomic operations for process synchronization. They are used for controlling the access of shared or common data by multiple processes.


Related Solutions

Which of the following statements about the one-way ANOVA are correct? (Select all that apply.) a....
Which of the following statements about the one-way ANOVA are correct? (Select all that apply.) a. The results of the ANOVA F test does not tell us which groups are different or how different they are. b. The larger the variability within groups relative to the variability between groups, the larger the F test statistic tends to be. c. In one-way ANOVA, the mean square for error (MSE) gives a measure of the variation within the samples, while the mean...
Which of the following statements are correct about a sample weighting process? Select all that apply....
Which of the following statements are correct about a sample weighting process? Select all that apply. A. Respondents are weighted in terms of their answers to the survey questions. B. The process is to correct survey data for any possible sampling biases. C. The sample is checked against known demographic characteristics of the adult population. D. Respondents are weighted in terms of their demographic characteristics such as race, age and gender.
Which of the following statements are correct (Select all that apply): Select one or more: A....
Which of the following statements are correct (Select all that apply): Select one or more: A. An income statement reports on financing activities. B. A balance sheet reports on investing and financing activities. C. The statement of cash flows reports on cash flows from operating, investing, and financing activities over a period of time. D. A balance sheet reports on a company's assets and liabilities over a period of time. E. The statement of equity reports on changes in the...
Which of the following statements are correct (Select all that apply): Select one or more: A....
Which of the following statements are correct (Select all that apply): Select one or more: A. A balance sheet reports on investing and financing activities. B. An income statement reports on financing activities. C. The statement of equity reports on changes in the accounts that make up equity. D. The statement of cash flows reports on cash flows from operating, investing, and financing activities over a period of time. E. A balance sheet reports on a company's assets and liabilities...
Which of the following statements are true? There are several, select all that are correct. Consider...
Which of the following statements are true? There are several, select all that are correct. Consider each statement on its own separate from the others listed. Question 7 options: A Call option gives its owner the right to buy a share off stock at fixed price within a specified period of time. The exercise value of an option is the payoff from immediately exercising the option minus the price paid for the option contract. An option's value is determined by...
Which of the following statements are true? There are several, select all that are correct. Consider...
Which of the following statements are true? There are several, select all that are correct. Consider each statement on its own separate from the others listed. Question 18 options: The relationtship stipulated in the purchasing power parity (PPP) equation is also called the law of one price Two reasons why financial management of a multinational company differs from that of purely domestic firms are: (1) different economic systems and (2) accounting systems In a monetary system with floating exchange rates,...
Which of the following statements about the cost of capital is CORRECT ? Select one: a....
Which of the following statements about the cost of capital is CORRECT ? Select one: a. Both the cost of debt and equity financing will decrease when a nuclear plant company encounters a ban on nuclear power generation in certain states. b. Both the cost of debt and equity financing will decrease when a firm increases its debt/asset ratio. c. Both the cost of debt and equity financing will decrease when a firm expands into a risky new area. d....
47. Which of the following statements are correct? Select which option is correct. Select one or...
47. Which of the following statements are correct? Select which option is correct. Select one or more: The level of professional skepticism can be reduced where the auditor has past experience with the entity indicating the honesty and integrity of management. The level of professional skepticism needs to be maintained throughout the whole engagement. Professional skepticism implies an expectation of fraud or error, so is a biased viewpoint. Professional skepticism is not important in considering management's explanations for unusual trends...
Which of the following statements concerning an agent's duty of care is correct? Select all that...
Which of the following statements concerning an agent's duty of care is correct? Select all that apply. A. A gratuitous agent owes no duty of care. B. Agents have a duty to act with reasonable care. C. Only agents who are paid owe a duty of care. D. Agents with special skills are held to a higher standard of care because they are expected to use those skills.
Which of the following statements about the price elasticity of demand is correct? Select one: a....
Which of the following statements about the price elasticity of demand is correct? Select one: a. All of the above are correct. b. Price elasticity of demand reflects the many economic, psychological, and social forces that shape consumer tastes. c. The price elasticity of demand for a good measures the willingness of buyers of the good to move away from the good as its price increases. d. Other things equal, if good x has close substitutes and good y does...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT