fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
23.94k stars 1.34k forks source link

New threading model #4654

Open andydotxyz opened 4 months ago

andydotxyz commented 4 months ago

Checklist

Is your feature request related to a problem?

To work on race conditions and many locking challenges we agreed to revise the threading model (the "App thread"). This issue tracks the work required.

Is it possible to construct a solution with the existing API?

No response

Describe the solution you'd like to see.

dweymouth commented 4 months ago

Re-merge draw and event into one thread

This might be the easiest path, but it isn't necessarily the only one. We can keep them on separate threads as long as we have them lock when reading or writing state.

That being said, unless we need to work around platform issues (ie #2 on the checklist), merging them to one thread might be the way to go.

I'll also add another checklist item for removing all the now-unneeded locks/sync stuff throughout the codebase

andydotxyz commented 4 months ago

Re-merge draw and event into one thread

This might be the easiest path, but it isn't necessarily the only one. We can keep them on separate threads as long as we have them lock when reading or writing state.

Yes, there could be locking based solutions - but part of this is trying to find the simplest solution, so reverting the thread split seems like a good start.