Create a Producer-Consumer program that simulates a marketplace. Producer and Consumer Threads should try to access an inventory of products where producers add to the inventory by producing products while consumers reduce the inventory by consuming products.
The product inventory will contain an array of products with a definite size which keeps track of how much of a product remains.
Make sure that the product inventory will remain accurate even when multiple consumer threads and multiple producer threads try to access and update the inventory.