M
M
MdaUZH2016-08-24 11:36:27
Java
MdaUZH, 2016-08-24 11:36:27

When does it make sense to use two threads?

Hello...
I stumbled upon the idea and when is it worth it, and when not to use more than 1 thread?
Obviously, the second thread has a place to be in an application where many background tasks are running, or, for example, take the same player, the second thread for playing music, so that it does not stop ..
But for example, I have a simple application, there is an animator and a timer (1 second 8 times), and while the timer counts down, the user must make a choice.
Does it make sense to push the timer into a separate thread?
To be honest, I have little idea of ​​​​everything when it should and when not, I still came from php)))))))))
Thank you all in advance)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question