Coder Social home page Coder Social logo

dkormalev / asynqro Goto Github PK

View Code? Open in Web Editor NEW
125.0 125.0 18.0 323 KB

Futures and thread pool for C++ (with optional Qt support)

License: BSD 3-Clause "New" or "Revised" License

CMake 3.93% Shell 2.48% C++ 91.34% Dockerfile 0.15% Python 2.10%
cpp cpp17 future hacktoberfest monad multithreading promise qt threadpool

asynqro's People

Contributors

dkormalev avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

asynqro's Issues

Add support for subpools grouping or adding as children to other subpools

In some cases it is beneficial to group few subpools together so they would each be restricted by their own limits and also will be restricted together.
For example, we have 500 subpools of 2 concurrent jobs each. We don't want to run more than 10 jobs across all subpools. Grouping all 500 of them and setting the limit to 10 would help in this case. Alternative way is to make subpools a tree (need to be checked if will not add too much extra work for cases when it is not needed).

More hyperlinks to benchmarked libraries in README.md please

Hi @dkormalev, I've just seen your great talk, and I'm having trouble identifying which "threadpoolcpp" library you mention -- a google search yields more viable repositories than I'd expect. Could you please update all the occurrences of "threadpoolcpp" in your README.md with a proper link to its original source repository? The other libs are well-known enough so that I know exactly which ones you talk about (e.g. in case of boost, TBB, Qt, or folly). Thanks.

Is it possible to manually run a queued task in the current thread?

Hi,

I am trying to parallelize a library with a synchronous interface, preserving backwards compatibility. Even if the interface doesn't use Futures, I could still do something like this:

Frame Clip::getFrame() {
    Frame frame = /* */;
    if (task_not_ran)
        frame.plane = queue_task();
    return frame;
}

Plane Frame::getPlane() {
    while (!plane.isCompleted()) {
        wait_first_of(plane, tasks_pending);
        if (!plane.isCompleted())
            run_pending_task();
        else
            break;
    }
    return plane.result();
}

The idea is: since the current task has to wait for a result but cannot be evicted from the thread, it can run pending tasks recursively until the result is ready.

This is obviously worse than having a fully asynchronous interface, but could make it possible to parallelize already existing code and binaries.

Is such a thing possible?

Thanks.

More examples

Hi,

this library looks absolutely perfect, just I don't see much examples (mainly for task scheduler) and installation instructions.

Is making of more examples planned in near time?

Thanks

  • gamiee

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.