You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to make a cross platform threadpool library in c and I came across this library and I started to examine it but I don't get it how is it working.
The thing that I don't understand is that for example if I have 4 threads in the threadpool and I give all 4 of them work to do and its going to take a long time, in this case 1 minute, if I add 20 work into the queue before the 1 minute mark, they all will signal for threads but no one will be able to get that signal (as they are not waiting for any signal) and miss the signal and then I noticed that you added an integer v in bsem because of it it will take atleast one job after the first initial intensive job but then after this how does the thread know if there are any jobs left in the queue. There is no signal to inform the threads and the integer v is 0 after taking the 2nd job.
I tried this library in linux because of signals .I made the above mentioned scenario, and it still worked. I don't get it how is it working.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered:
I am trying to make a cross platform threadpool library in c and I came across this library and I started to examine it but I don't get it how is it working.
The thing that I don't understand is that for example if I have 4 threads in the threadpool and I give all 4 of them work to do and its going to take a long time, in this case 1 minute, if I add 20 work into the queue before the 1 minute mark, they all will signal for threads but no one will be able to get that signal (as they are not waiting for any signal) and miss the signal and then I noticed that you added an integer v in bsem because of it it will take atleast one job after the first initial intensive job but then after this how does the thread know if there are any jobs left in the queue. There is no signal to inform the threads and the integer v is 0 after taking the 2nd job.
I tried this library in linux because of signals .I made the above mentioned scenario, and it still worked. I don't get it how is it working.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: