Click here to Skip to main content
14,929,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Let's say I have 3 kinds of bakery shops.I wanna have a buffer for each one of them.With that way i can control producing-consuming for each bakery shops. How can I implement it to c language with Pthreads?

Thanks in advance

What I have tried:

Unfortunetly until now i didnt try anything. I am trying to understand multiple buffers.
Updated 9-Jan-21 7:37am

You may find (just Google for) many pthread code samples about the producer-consumer problem. They could be your starting point.
at first you must learn and understand the basic of C and multi-threading is an advanced theme. Looks like soome pthread tutorial.
You can imagine it as some persons are in the kitchen and are cooking together. The biggest problem is to explain them how the understand each other and have to wait for each other in some form.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900