JayThomason / Tutti

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

Bugfix: Prevent music library exchange while loading local/remote music #228

Open hwray opened 10 years ago

hwray commented 10 years ago

Right now, we aren't waiting on any of our threads that load music into the library. These include:

We need to make sure of several things:

I talked with @JayThomason and we decided these things can probably be easily solved with an exclusive loaderLock that wraps around the relevant code blocks.

JayThomason commented 10 years ago

I implemented the lock solution in the DBHandler that we previously discussed and tested it by accepting requests on the master from two clients one after another as quickly as possible. It seemed to work well -- I watched as one phone loaded just the music from the master and then the other phone loaded the music from the first two and finally the first phone got the forwarded music from the second.

https://github.com/JayThomason/Tutti/commit/9574b677c6726d8214118d9378d03a1dd5aefa57

hwray commented 10 years ago

I'm going to reopen this for now. It looks like the solution of synchronizing the DB loader methods is causing our UI to freeze up for pretty long periods when new Clients join the jam. We may have to come up with another solution.