Commit Graph

12 Commits

Author SHA1 Message Date
3773ebe354 Fixed after removing TBB deprecated APIs 2021-06-23 15:24:05 +02:00
50b4f08e37 drop deprecated TBB components (#6590)
Quite some time ago, many of the TBB components were deprecated in favor
of their near-equivalents in the STL or, in the case of task_scheduler_init,
were broken up and reconstituted under a less ad-hoc logic. Every time a header
file marked deprecated gets included, a rather loud warning is emitted, which
leads to a complete TBB's domination over the stderr stream during build time,
making it harder to notice _legitimate_ warnings.

Instead of merely muting the output with TBB_SUPPRESS_DEPRECATED_MESSAGES,
perform a genuine migration away from the deprecated components with the added
benefit of achieving a source compatibility with oneTBB, the successor to TBB
which has dropped the deprecated API for good.

What got replaced for what?

| Deprecated				| Replacement					|
| ------------------------------------- | --------------------------------------------- |
| `tbb::atomic`				| `std::atomic`					|
| `tbb::mutex`				| `std::mutex`					|
| `tbb::mutex::scoped_lock`		| `std::scoped_lock<std::mutex>`		|
| `tbb::mutex::scoped_lock` (empty)	| `std::unique_lock<std::mutex>` (deferred)	|
| `tbb::task_scheduler_init`		| `tbb::global_control`				|
| `tbb::this_thread`			| `std::this_thread`				|

Signed-off-by: Roman Beranek <roman.beranek@prusa3d.com>
2021-06-23 11:48:48 +02:00
703b84b165 Fix of PrusaSlicer hangs on Linux when run with non standard task affinity #5661 2021-01-04 09:03:49 +01:00
4ff8ff96de Include <atomic> for std::atomic where needed
Fixes build on linux using clang 11
2020-12-13 19:41:47 +01:00
8fde0a085b Refactored loading of Get/SetThreadDescription() on Windows:
These new API functions are not available on Windows 7 and on older Windows 10,
thus they are newly loaded dynamically and the functions using it retur
a bool indicating whether the functionality is supported or not.
Also the OSX variants that are not supported newly return false instead
of throwing an exception.

Fixes #4972 #4974
2020-10-26 08:09:17 +01:00
f7c495df6d Fix couple of build issues on gcc 2020-10-23 07:51:58 +02:00
37e1c94fe3 Workarounds and documentation of OSX posix incompatibilities 2020-10-22 14:57:50 +02:00
f02bf51471 Workaround for OSX non-compliant implementation of
pthread_getname_np / pthread_setname_np
2020-10-22 14:45:15 +02:00
c939ee02d3 and again a fix on Windows 2020-10-22 14:35:20 +02:00
c10efd192c Fixes of previous commit on Posix platforms 2020-10-22 14:29:40 +02:00
da9d9f9ceb Thread names shortened to 15 characters to fit Posix norm.
Added get_current_thread_name()
2020-10-22 14:11:08 +02:00
d5e4bce750 Support for naming slicer own threads for debugging.
The following threads are named with this commit:
slic3r_main, slic3r_BackgroundSlicingProcess,
slic3r_tbbpool_xx_yy where xx is a one based index of the TTB thread
and yy is the platform thread ID.
2020-10-22 13:54:15 +02:00