+ 1
what can threads be used for???
3 Respuestas
+ 4
You can use them to increase performance as more work can be done concurrently. However the workload must be parallelizable. This can be useful in server and OS operations. You must be careful tho to synchronize so that race conditions do not occur. I would suggest researching more
+ 4
Some actions like loops sometimes cause the app to hang. The reason is:when you create an app , it always has a MAIN THREAD which handles UI operations. When a long action like a long loop runs on MAIN THREAD , the thread stops handling UI actions and process the loop , which cause the UI of the app to get LOCKED until the loop isn't finished . So if you excute the loop on another thread it won cause the app UI to get locked.
0
for background processing