I am trying to write a program to process images. The aim is to process different parts of an image at the same time. So i am using multithreading.
Lets say the input image has 1000 rows. Each thread is supposed to process 100 rows at one time. So 10 threads would do the job. But i want to have 3 threads working at the same time. So i decided to use JOINABLE threads. And with pthread_join i wait for each 3 threads to finish their jobs. Then i call the other three threads.
It is working now. But my problem is I want to start a thread when a previous thread finishes its job, without waiting for the other two threads to finish their jobs.
something like this
Thread4 Active --->Thread4 doesnt wait for 2. and 3. to finish their jobs