MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #29935 All Revisions ] Back to Issue ]
Summary 0029935: Foundation Classes - introduce OSD_ThreadPool class defining a thread pool
Revision 2018-07-08 00:23 by kgv
Description It is desired to provide a Thread Pool class having the following properties:
- Thread pool allocates specific number of threads and keeps them alive (in sleep state when inactive) until destruction.
- Thread pool defines a predefined number of threads having unique indices within continuous range. This would allow algorithms allocating thread-local variables in a straight-forward way (by allocating an array of variables per thread). This may include resources like shared file handles.
- Thread pool can be re-used by the same thread within nested algorithms, limiting overall number of threads to be used.
- Thread pool can be shared across thread in thread-safe way.
- Default thread pool to be used by algorithms.
- Working threads catch exceptions and redirect them to launcher thread as Standard_Failure.

This interface will be also applicable to parallelization task implying blocking APIs (like reading files).

Note that this Thread Pool implementation would NOT be based on TBB library even when it is enabled. The reason, is that TBB does not specify similar API.

It is considered that OSD_Parallel::forEach() will use new class to avoid spawning unlimited number of threads.
Revision 2018-07-07 02:18 by kgv
Description It is desired to provide a Thread Pool class having the following properties:
- Thread pool allocates specific number of threads and keeps them alive (in sleep state when inactive) until destruction.
- Thread pool defines a predefined number of threads having unique indices within continuous range. This would allow algorithms allocating thread-local variables in a straight-forward way (by allocating an array of variables per thread). This amy include resource like shared file handles.
- Thread pool can be re-used by the same thread within nested algorithms, limiting overall number of threads to be used.
- Thread pool can be shared across thread in thread-safe way.
- Default thread pool to be used by algorithms.

This interface will be also applicable to parallelization task implying blocking APIs (like reading files).

Note that this Thread Pool implementation would NOT be based on TBB library even when it is enabled. The reason, is that TBB does not specify similar API.

It is considered that OSD_Parallel::forEach() will use new class to avoid spawning unlimited number of threads.


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker