So I know how to code the Producer/Consumer problem, but I do not know why it works and why rearranging the code makes it not work.
int sizeOfBuffer = 1000; s