I have been working all the night on the following problem:
'Sometimes' the producer threads of my Threadpool was hanging ,
and i have finally discovered what is the problem...
In the push() method inside lockfree_mpmc.pas you will see that
it is using a repeat until , this tight loop around the CAS
was not working properly and was hanging the producer threads
from time to time, and the solution to this problem was to
add a sleep(0) in this tight loop.
Now Threadpool is working perfectly , and is perfectly stable
- i have tested it all the night ! - .
Please download all my modules that contains lockfree_mpmc.pas
- like ParrallelQueue, Threadpool, Pthreadpool , Parallel compression ,
Parallel Quicksort etc. -
Amine Moulay Ramadne
I have retested my ParallelQueue algorithm , it's perfectly stable
and it is scoring the same in my benchmarks on an Intel Core
2 Quad Q6600:
17 millions of pop() transactions per second !
3.4 millions of push() transactions per second !
And i am using ParallelQueue inside my Thread Pool Engine.
Amine Moulay Ramdane.