Answer the question
In order to leave comments, you need to log in
Application structure with calculations in an infinite loop?
Let's say there is a button, its task is to run an infinite loop in the function, some calculations that should be displayed in the form of text and graphics (canvas). Each new click starts calculations with different data. How to do it right? Create a new thread on each click and check if there is one already running, exit it and then start a new one? Or pass something to the stream (some variable) and constantly check this data? Or use after, but then you need to store the calculation data somewhere, since the function will be executed without a loop.
How to implement correctly? How does is called? What are the practices? What to look for?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question