For this assignment, there is a functioning serial program that processes a batch of bank transactions
For this assignment, there is a functioning serial program that processes a batch of bank transactions. Your job is to convert this into a multithreaded Producer/Consumer model program using a busy-wait approach. The tests for this program have been set up in Canvas via the CODE plugin and the serial version passes all of these tests. Your multithreaded version should also pass the tests, along with compiling and running with no errors or warnings and having no style errors.
Notes:
You should copy the bankingSystemSerial.cpp program to bankingSystemMT.cpp and make that be the multithreaded version.
You should use 1 producer thread that will add transactions to the queue and 3 consumer threads that process them.
Use a maximum queue size of 8
The producer should process all of the “create” actions before adding work to the queue
The usleep instructions in the processTransactions function should be considered as being part of the critical section
You should lock only what is required to avoid race conditions: Locking the entire transactions vector will result in a single-threaded program and you will not be able to get full credit.
When the program is running correctly, these are the final balances in each of the 15 accounts. You can also get this by running the bankingSystemSerial program
Account : 1000 $-377.13
Account : 1001 $1466.54
Account : 1002 $3873.19
Account : 1003 $7781.32
Account : 1004 $8030.92
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
