Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Guile Futures for executing user actions #29

Closed
Frewacom opened this issue Jan 18, 2023 · 1 comment
Closed

Use Guile Futures for executing user actions #29

Frewacom opened this issue Jan 18, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Frewacom
Copy link
Member

Guile Futures allows us to evaluate expressions in a threaded environment without the large overhead cost of spawning threads. This would prevent any issues with user actions blocking the main thread of dwl-guile, removing the need for something like eval-async.

@Frewacom Frewacom added the enhancement New feature or request label Jan 18, 2023
@Frewacom
Copy link
Member Author

Frewacom commented Apr 8, 2023

I did some experimenting with this and realised that it is not quite this simple. Calling dwl-guile bindings from futures can cause really weird behaviour because of it not being executed in the main thread. If this binding does something that affects the rendering in dwl, the result can be UB.

Commit 5d9211c prevents thread safety issues in eval-async, and also renames it dwl:run-async for consistency. However, the solution is nowhere near fast enough to be used for all user bindings, and the extra overhead is not at all worth it.

@Frewacom Frewacom closed this as completed Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant