Tuesday, April 21, 2020

Digest for comp.programming.threads@googlegroups.com - 1 update in 1 topic

aminer68@gmail.com: Apr 20 12:49PM -0700

Hello,
 
 
About the Threadpool..
 
I have just read the following:
 
Concurrency - Throttling Concurrency in the CLR 4.0 ThreadPool
 
https://docs.microsoft.com/en-us/archive/msdn-magazine/2010/september/concurrency-throttling-concurrency-in-the-clr-4-0-threadpool
 
 
But i think that both the methodologies from Microsoft of the Hill Climbing and of the Control Theory using band pass filter or match filter and discrete Fourier transform have a weakness, there weakness is that they are "localized" optimization that maximize the throughput
, so they are not fair, so i don't think i will implement them, so then you can use my following invention of an efficient Threadpool engine with priorities that scales very well (and you can use a second Threadpool for IO etc.):
 
https://sites.google.com/site/scalable68/an-efficient-threadpool-engine-with-priorities-that-scales-very-well
 
And here is my other Threadpool engine with priorities:
 
https://sites.google.com/site/scalable68/threadpool-engine-with-priorities
 
 
And read my following previous thoughts to understand more:
 
About the strategy of "work depth-first; steal breadth-first"..
 
I have just read the following webpage:
 
Why Too Many Threads Hurts Performance, and What to do About It
 
https://www.codeguru.com/cpp/sample_chapter/article.php/c13533/Why-Too-Many-Threads-Hurts-Performance-and-What-to-do-About-It.htm
 
Also I have just looked at the following interesting video about Go scheduler and Go concurrency:
 
Dmitry Vyukov — Go scheduler: Implementing language with lightweight concurrency
 
https://www.youtube.com/watch?v=-K11rY57K7k
 
And i have just read the following webpage about the Threadpool of microsoft .NET 4.0:
 
https://blogs.msdn.microsoft.com/jennifer/2009/06/26/work-stealing-in-net-4-0/
 
 
And as you are noticing the first web link above is speaking about the strategy of "work depth-first; steal breadth-first" , but we have to be more smart because i think that this strategy, that is advantageous for cache locality, works best for recursive algorithms, because a thread is taking the first task and after that the algorithm is recursive, so it will put the childs tasks inside the local work-stealing queue, and the other threads will start to take from the work-stealing queue, so the work will be distributed correctly, but as you will notice that this strategy works best for recursive algorithms, but when you you iteratively start many tasks, i think we will have much more contention on the work-stealing queue and this is a weakness of this strategy, other than that when it is not a recursive algorithm and the threads are receiving from the global queue so there will be high contention on the global queue and this is not good. MIT's Cilk and Go scheduler and the Threadpool of Microsoft and Intel® C++ TBB are using this strategy of "work depth-first; steal breadth-first". And as you are noticing that they are giving more preference to cache locality than scalability.
 
But in my following invention of a Threadpool that scales very well i am
giving more preference to scalability than to cache locality:
 
https://sites.google.com/site/scalable68/an-efficient-threadpool-engine-with-priorities-that-scales-very-well
 
Other than that when you are doing IO with my Threadpool, you can
use asychronous IO by starting a dedicated thread to IO to be more efficient, or you can start another of my Threadpool and use it for tasks that uses IO, you can use the same method when threads of the my Threadpool are waiting or sleeping..
 
Other than that for recursion and the stack overflow problem
you can convert your function from a recursive to iterative
to solve the problem of stack overflow.
 
Other than that to be able to serve a great number of internet connections or TCP/IP socket connections you can use my Threadpool
with my powerful Object oriented Stackful coroutines library for Delphi and FreePascal here:
 
https://sites.google.com/site/scalable68/object-oriented-stackful-coroutines-library-for-delphi-and-freepascal
 
 
 
Thank you,
Amine Moulay Ramdane.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.programming.threads+unsubscribe@googlegroups.com.

No comments: