JayThomason / Tutti

Tutti is a shared music application for the car being made in conjunction with Audi.
3 stars 1 forks source link

Bug: Loading remote music temporarily freezes the UI instead of live-updating #243

Closed hwray closed 10 years ago

hwray commented 10 years ago

With all the recent changes, somehow we've taken a step back here as well. When loading remote music, our UI/UX is now temporarily freezing and then updating with a dump of all the new music, instead of live-updating each time an artist/song is loaded and allowing the user to continue interacting.

hwray commented 10 years ago

I'm wondering if this has something to do with the addition of the synchronized keyword to the library loader methods... No real idea though.

hwray commented 10 years ago

Yes, it appears that this is a result of the synchronized keyword being added to the DatabaseHandler.

For now, I may just comment out the synchronization. I think a smooth UX for joining jams is much more important for the software faire than trying to maintain perfect library exchanges in the case that multiple clients join rapidly.

What do you think @JayThomason ? Can you think of a different / more granular solution that we could get working in time?

hwray commented 10 years ago

Commented out the keywords here:

https://github.com/JayThomason/Tutti/commit/71cc2842c09555d210a2b9f22512b251da25a2f7

JayThomason commented 10 years ago

Did this actually fix the problem? I don't know why the UI would freeze when nothing in the UI is calling any of the methods that are being synchronized.

hwray commented 10 years ago

Yep, it's a 1-to-1 correspondence between the syncing and the freezing. Not sure why either.

JayThomason commented 10 years ago

We could try replacing the synchronized keyword with a dedicated mutex and see what happens. I'm pretty unsure of what the problem is.

It seems as if both of the methods which would conflict (loadMusicFromJSON and getLibraryAsJSON) are called from non-UI threads, so I don't understand why the UI would lock up.