2. Given the following producer&consumer problem solution, what is the potential risk in the code when the solution is running on a single CPU, multitasking operating system? Assume we need run multiple producers and consumers at the same time, modify the code to remove the risk using any solution that is proper. (10 pt) Producer while (true) /* produce an item and put in nextProduced */ while (countBUFFER_SIZE) // do nothing buffer [in]nextProduced; in-(in + 1) %
OR
OR