GithubHelp home page GithubHelp logo

Comments (4)

hkaiser avatar hkaiser commented on May 27, 2024

@Pansysk75 Yep, that's caused by the direct execution patch. cancelable_action should call get_outer_id instead (here:

). Excellent catch!

from hpx.

hkaiser avatar hkaiser commented on May 27, 2024

@Pansysk75 Yep, that's caused by the direct execution patch. cancelable_action should call get_outer_id instead (here:

). Excellent catch!

I just realized that we don't have that - what an oversight! It should be added here:

HPX_CORE_EXPORT thread::id get_id() noexcept;
and here:
thread::id get_id() noexcept
{
return thread::id(threads::get_self_id());
}

The new code should be:

        thread::id get_outer_id() noexcept
        {
            return thread::id(threads::get_outer_self_id());
        }

from hpx.

Pansysk75 avatar Pansysk75 commented on May 27, 2024

That should work, but as a user I would really wonder what "outer" refers to and why I should use that (if I didn't know the implementation details).
I was thinking of perhaps modifying the yield operation so that the state before and after the yield would be the same, if that is at all possible. That should make 'hpx::this_thread::get_id()' return some constant id (the one of the thread being "directly executed" i suppose)
Is there a good reason why a different id should be reported right after suspension? Is it a bug or is it something that we expect?

from hpx.

hkaiser avatar hkaiser commented on May 27, 2024

Alternatively we could make the current implementation of get_id call the get_outer_self_id instead. Not sure what this would break, though...

from hpx.

Related Issues (20)

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.