WickedEngine | 3D engine with modern graphics | Game Engine library
kandi X-RAY | WickedEngine Summary
kandi X-RAY | WickedEngine Summary
3D engine focusing on modern rendering
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of WickedEngine
WickedEngine Key Features
WickedEngine Examples and Code Snippets
Community Discussions
Trending Discussions on WickedEngine
QUESTION
I've got a thread pool
...ANSWER
Answered 2020-Nov-09 at 14:46First, your pool creates 4 working threads. Then, in main
, you add some tasks into the pool queue, which call dss.DoSomething();
.
The workers then start executing these tasks. Inside, they first enqueue some more tasks, and then, they start waiting for their futures forever. These waits never end since there are no threads that could start resolving the next enqueued tasks.
Creating a thread pool with the ability to enqueue tasks from within processed tasks is not trivial. Basically, what you would need is to suspend the current task here instead of waiting. There is no native mechanism for this in C++ (at least, until C++20 coroutines).
As a workaround, you can use OpenMP or Intel TBB, which both provide the described functionality. For example, in OpenMP, you can suspend a current task and wait for its sub-tasks completion with #pragma omp takswait
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install WickedEngine
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page