Giter Club home page Giter Club logo

task-pool's People

Contributors

benny-edlund avatar bennyedlund avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hamedsabri

task-pool's Issues

Allow deferred tasks to execute on main thread

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

Pipelines block on abort()

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.

Investigate possibility to customize promise type used for tasks

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.