Threading issues

I don’t know if this is the right forum to ask this. Please move it if you find it doesn’t fit here.

I’m developing a slideshow app. I’m using Java2D and the javalayer lib to play MP3 files as background music for the slideshows. I’m drawing the images using active rendering on a JPanel implementing Runnable and the music plays in its own thread too. I had to lower the priority of the drawing thread because the music one wouldn’t start until the end of the slideshow, and I want the music to play during the slideshow. I have a problem though, every time there is a transition between the slides, the music stops for a second or something and then it continues. I’m a bit lost about this issue, so any guiding in the right direction would be appreciated.

Thanks

Do you have a Thread.sleep() or Thread.yield() in your rendering loop? If you have a tight rendering loop, it could be starving the music thread of processing cycles, so it only starts playing at the end of the show. Also check you have synchronized in the right place, could also be a deadlock.