In C++ improve my multithreading
I'm looking for an A quality answer. The due is 22st at 4pm (UTC-08:00 pacific time us&canada)
here is the instruction for this assignment.
In C++
Improve my multithreading example as follows:
(for both, reader and writer):
1. While not available do:
Enter the sleep mode
Wake and check the resources
End:
2. Acquire the lock on the resourece
3. Check if still available (It may be taken from you in the process between you checked for the resources and tried to set the lock
Think what you do if that becomes inavailable.
4. Read/write the file
5. Do not forget to properly clean up after yourself: In my code I did not close the file; that is an error, esp in this app.
6. Release the lock
7. Done with the thread.
Main should wait for both threads to complete, and output some status message.
Edit question's body
6 years ago
50
- u1d1
- research the market in the UK. Current and future forcasts. Politacal, sociological, cultural, economical. Be difinitive and factual
- BFIN 3321 Exam
- Assignment
- Interviewing, Follow-Up and Negotiating Job Offers HELP. . A+++ Paper, Original Work, No Plagiarism Please. APA Format. 5-7 Pages (BODY OF PAPER),Abstract, Introduction, Conclusion, Reference Page
- Homework 2
- Assignment
- emotional responses and motivated behaviors
- CJ303 Assignment
- Earth Science diss. #4