Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking to set up two threads in my puzzle game, one for logic/graphics, and one for audio. Am I correct in thinking that the thread that handles the audio should be set as a daemon thread, because the game can end without that thread finishing?

share|improve this question
up vote 2 down vote accepted

Yes, but.

  • If you exit using System.exit() then it will shut down your audio thread anyway.
  • It's probably tidier to send a message to the audio thread telling it to shut down and close its streams.
  • You should consider having three threads unless the logic is really simple.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.