4
\$\begingroup\$

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?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

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.
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .