Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.