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

Add goroutine6 #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add goroutine6 #70

wants to merge 1 commit into from

Conversation

rcalixte
Copy link
Contributor

Ported from:
https://github.com/therecipe/examples/blob/master/advanced/widgets/goroutine/main.go

The labels and the goroutines sometimes freeze until the window focus is changed or the window is moved. I tried different time values but wasn't able to have a 100% consistent execution. It works well enough for an example hopefully.

@mappu
Copy link
Owner

mappu commented Nov 11, 2024

This is a really good example, and I think the stuttering shows that goroutines must currently be handled slightly differently in MIQT. It is possible to make this perfectly smooth, but MIQT does not yet have an equivalent to therecipe/qt's label.UpdateTextFromGoroutine method.

I'd like to fix the bug and make it smooth before merging it. This is also related to #72.

Probably the fix is either

  • (Fix Go-side): the goroutine should push to a channel, and the main thread should pull channel events (but this needs a way to integrate with the blocking Exec() call); or else
  • (Fix Qt-side): emit a signal with a callback parameter, which can always be caught and executed on the main event loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked A blocker prevents this from progressing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants