benny-edlund / task-pool Goto Github PK
View Code? Open in Web Editor NEWA task orient thread pool library for C++14 with cancellation and allocator support
License: MIT License
A task orient thread pool library for C++14 with cancellation and allocator support
License: MIT License
Some production use shows there is too overhead in processing the input queue so we will need to use some facility to wait for tasks in a more efficient way
Currently the library uses only std::promise and it could be useful if users could customize the promise type used in task return values.
As task_pool is not templated the only customization point would be the submit function and as the task_proxy holder class is type erased it might be trivial to allow the user to supply their own promise type.
Pipes do not check a stop token on destruction and may as such block on task_pool::abort if they have been ingested into another task. In this situation the pipe object will hold a valid future which it will attempt to wait for during destruction and hence will block the reset of the pool_runtime given that there are no threads able to fulfill the promise.
The obvious solution might seem to be to check the pipes pool member if the stop token has been set however since this is a deferred call to the pool_runtime we may get an unexpected result of false in this case since the runtime pointer might have been reset in the reference pool instance.
When integrating with other tasking systems its useful to be able to defer tasks from a thread onto the main thread.
We can use existing std::launch to specify when a function should be called in the threadpool or when it should be called deferred and then implement a function to be called to process these functions in another task system like a UI event loop or a programs main loop
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.