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

Threading #39

Open
miek opened this issue Oct 4, 2015 · 1 comment
Open

Threading #39

miek opened this issue Oct 4, 2015 · 1 comment

Comments

@miek
Copy link
Owner

miek commented Oct 4, 2015

The FFT calculation + pixmap generation really needs to be pushed out of the UI thread.

I'm thinking something like this:

  • paintEvent figures out what tiles it needs to display, loops through requesting from the cache and displaying them.
  • On a cache miss, that tile ID is added to a job list.
  • Worker thread(s) pop a job off the list, do the processing, then insert FFT results & pixmap data into the cache.
  • Once a new tile is done, call invalidate() on that area and paintEvent should run again.

A long scroll on a slow machine could queue up a lot of jobs, including ones are way out of view once the scrolling is done. I'm thinking the jobs should be processed by most recent first, then the job list should be limited in length with older jobs being discarded.

As a future addon I want to be able to peek ahead and start processing nearby tiles ready to be shown. Just adding these to the end of the job list if there's space should work (they should not be higher priority than jobs for the current view).

@miek
Copy link
Owner Author

miek commented Apr 24, 2016

Done in f20d99a, spectrogram plot still needs to be ported to use it

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

No branches or pull requests

1 participant