Giter Club home page Giter Club logo

Comments (5)

Dangerise avatar Dangerise commented on July 17, 2024 1

In fact, even AsyncFileDialog is block, .await means the task will blocked until it complete

to solve it, I think you should spawn another task to call AsyncFileDialog , and let your main loop check whether it is completed.

from rfd.

valadaptive avatar valadaptive commented on July 17, 2024 1

Yes, but in the current code, the thread that the executor is running on is blocked, because the future blocks when polled. This means that no other futures can be executed while the file dialog is open, and if the executor is running on the main thread, the application itself will freeze. That's what I'm fixing.

from rfd.

valadaptive avatar valadaptive commented on July 17, 2024

In fact, even AsyncFileDialog is block, .await means the task will blocked until it complete

That's not how Futures work in Rust. When you await a future, it doesn't block the thread; it causes the task to "yield" (within whatever executor you're using, it'll move on to the next task to be executed, and probably won't poll that future again until the task is awoken).

from rfd.

Dangerise avatar Dangerise commented on July 17, 2024

@valadaptive I mean, the thread won't be blocked, but the task will be blocked, even it's async

from rfd.

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.