Question: Part 1 . ( 1 0 0 points ) Guess My Number - MT . In this lab, we implement the Guess My Number game

Part 1.(100 points) Guess My Number - MT. In this lab, we implement the Guess My Number game again, using threads! The game is the same as described in Lab 6, and we still call the two people in the game C and P. C generates a random number and P uses a binary search to guess the number. In the multithreading version, C and P are threads. Although they share the memory space, P is honest and does not peek at the answer. No cheating! In this problem, thread C and thread P use a shared structure (thread_arg_t) to exchange information. Of course, they need a mutex and condition variables to coordinate. In the starter code, the structure already has one mutex and two condition variables. The status field indicates the status of the shared data. Let us recap the protocol between C and P.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!