I'm trying to synchronize one producer thread and two consumer threads. All the threads are sharing an image buffer. The producer thread updates the image in the buffer every 33ms (webcam rate). Each consumer thread does individual and independent processing on the image.

My idea is that as soon as the producer thread updates the image in the buffer, it will wake up the consumer threads. The consumer threads will process the image as soon as woken up and when it is done with the process, the thread will be put to sleep.

What synchronization is most effective in implementing this? TIA.