lz_MultiThreadProcs
lz_MultiThreadProcs
is a Library for parallel algorithms.
A parallel algorithm, as opposed to a traditional serial algorithm,
is an algorithm which can be executed a piece at a time on many different processing devices and then combined together again at the end to get the correct result.
The parallelism in an algorithm can yield improved performance on many different kinds of computers.
For example, on a parallel programming, the operations in a parallel algorithm can be per formed simultaneously by different processors. Furthermore, even on a single-processor computer the parallelism in an algorithm can be exploited by using multiple functional units, pipelined functional units, or pipelined memory systems.
Parallel algorithms on individual devices have become more common since the early 2000s because of substantial improvements in multiprocessing systems and the rise of multi-core processors.
Up until the end of 2004, single-core processor performance rapidly increased via frequency scaling, and thus it was easier to construct a computer with a single fast core than one with many slower cores with the same throughput, so multicore systems were of more limited use. Since 2004 however, frequency scaling hit a wall, and thus multicore systems have become more widespread, making parallel algorithms of more general use.
Features
- A procedure or method is executed with an Index running from an arbitrary StartIndex to an arbitrary EndIndex.
- One or more threads execute these index' in parallel. For example if the Index runs from 1 to 10 and there are 3 threads available in the pool, then 3 threads will run three different index at the same time. Every time a thread finishes one call (one index) it allocates the next index and runs it. The result may be: Thread 1 executes index 3,5,7, thread 2 executes 1,6,8,9 and thread 3 runs 2,4,10.
- The number of threads may vary during run and there is no guarantee for a minimum of threads. In the worst case all index will be executed by one thread - the thread itself.
- The maximum number of threads is initialized with a good guess for the current system. It can be manually set at any time via
- You can set the maximum threads for each procedure.
- A parallel procedure (or method) can call recursively parallel procedures (or methods).
- Threads are reused, that means they are not destroyed and created for each index, but there is a global pool of threads. On a dual core processor there will be two threads doing all the work - the main thread and one extra thread in the pool.
You can explore Units, Functions, Procedures, Classes, etc in our
Source Documentation