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

Move events to main thread and remove unneeded locks #5322

Merged
merged 9 commits into from
Dec 17, 2024

Conversation

andydotxyz
Copy link
Member

@andydotxyz andydotxyz commented Dec 16, 2024

This means for race-free apps except for data binding and goroutines, which are covered later, separately.

Progresses #4654

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. Just one minor comment (not necessarily request for changes) inline. On more question: are there any parts where we should still support calling methods on different threads? Just asking so we don't get carried away and rip out too many locks at once :)

impl atomic.Pointer[fyne.Widget]
propertyLock sync.RWMutex
themeCache fyne.Theme
impl atomic.Pointer[fyne.Widget]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should atomic types and things from the async package also be removed or is that perhaps better to have as a separate PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering the same. I think later PR as it could impact semantics too

@Jacalz
Copy link
Member

Jacalz commented Dec 16, 2024

FYI: There seems to be compilation issues?

@andydotxyz
Copy link
Member Author

FYI: There seems to be compilation issues?

Yeah I just noteiced I didn't compile the tests for last refactor. Updated

@andydotxyz
Copy link
Member Author

On more question: are there any parts where we should still support calling methods on different threads?

I think it's just data binding which requires more work for various reasons.

@andydotxyz
Copy link
Member Author

Looks like there may be a deadlock on Linux only - I'll check it out tomorrow

Jacalz
Jacalz previously approved these changes Dec 17, 2024
Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work fine on Linux for me. Maybe deadlock is for tests only?

@andydotxyz
Copy link
Member Author

Seems to work fine on Linux for me. Maybe deadlock is for tests only?

Yes it was, or a codepath that was not executed on the testing. Fixed.

@coveralls
Copy link

coveralls commented Dec 17, 2024

Coverage Status

coverage: 59.644% (-0.3%) from 59.964%
when pulling 017e085 on andydotxyz:fix/mergethreads
into 7fea2eb on fyne-io:develop.

@andydotxyz
Copy link
Member Author

One thing led to another and I just refactored the event queue out in this PR too.

Fixes a few flakey tests :)

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Well done. I love it when the diff of added vs removed looks like it does now. It also feels like the event queue removal made a huge performance difference compared to a previous version of this PR :)

@andydotxyz andydotxyz merged commit d2fde27 into fyne-io:develop Dec 17, 2024
11 of 12 checks passed
@andydotxyz andydotxyz deleted the fix/mergethreads branch December 17, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants