Multithreading - Design Pattern code

I’m looking for

  1. publisher - Consumer code (with semaphore and mutex)
  2. Threadpool Code

Please help me.

Codechef is a forum where users ask questions regarding their codes and ask for help relating to the contests held here.

We do not provide code writing services for questions such as this where you are just asking us to write a code for you, while you relax and have fun.

If you specify a bit more details, narrow down your question to a certain point and show some code that can be used as a reference, you might get help. The chances of getting useful answers will increase a lot if you provide some code, so that other users have something to work on and they will also know what the approach you are trying is.