subject

Add 50 more 'rookieArtists' threads that paint. You may initialize their paint colors and starting positions randomly in a for-loop.
Artists should not have the same color (Think about what this would mean when debugging!)
Each artist has also agreed that they will not paint over each others work (the artists do respect each other--even the rookies). This means you need to enforce some locking mechanism.
I suggest using a 'trylock'
An example is provided under trylock. c
There should be no deadlock in this program.
Note: Care should be taken to minimize and only put locks around code that needs to be protected.
Locals in threads for example, do not need to be locked if they are not shared.
All of the artists should congregate (i. e. join) at the end of the program to admire their work.
You should output an image called "canvas. ppm" at the end of the program.
You may reference code from previous labs/assignments to understand the PPM format.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:30, vane3152
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
image
Computers and Technology, 23.06.2019 06:10, erick7123
The head restraint should be adjusted so that it reaches a. the top of your ears b. the base of your skull c. the top of the head
Answers: 1
image
Computers and Technology, 23.06.2019 15:10, cathyjuan
What role did women fill during world war ii?
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, isaiahhuettnerowgg8d
What is one reason why indoor air pollution has become an increasing problem.
Answers: 1
You know the right answer?
Add 50 more 'rookieArtists' threads that paint. You may initialize their paint colors and starting...

Questions in other subjects:

Konu
English, 20.03.2020 03:21