Louis writes a multithreaded program, which produces an incorrect answer some of the time, but always completes.

Question:

Louis writes a multithreaded program, which produces an incorrect answer some of the time, but always completes. He suspects a race condition. Which of the following are strategies that can reduce, and with luck eliminate, race conditions in Louis’s program?

A. Separate a multithreaded program into multiple single-threaded programs, run each thread in its own address space, and share data between them via a communication link that uses send and receive.

B. Apply the one-writer rule.

C. Ensure that for each shared variable v, it is protected by some lock lv.

D. Ensure that all locks are acquired in the same order.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Principles Of Computer System Design An Introduction

ISBN: 9780123749574

1st Edition

Authors: Jerome H. Saltzer, M. Frans Kaashoek

Question Posted: