InterviewSolution
| 1. |
Can You Name A Situation Where Joining Threads Should Be Avoided? |
|
Answer» A call to join() blocks the caller thread. This is really bad in situations where the caller thread is a main UI thread – because if the UI thread blocks, the application will stop responding to user inputs which will make it seem hanged. Another place where calling join() is not advisable is INSIDE a main game LOOP. Calling join() can BLOCK update and rendering of the game scene and SEVERLY impact the user experience (it'll be like watching a You tube video on a dial up internet connection !). A call to join() blocks the caller thread. This is really bad in situations where the caller thread is a main UI thread – because if the UI thread blocks, the application will stop responding to user inputs which will make it seem hanged. Another place where calling join() is not advisable is inside a main game loop. Calling join() can block update and rendering of the game scene and severly impact the user experience (it'll be like watching a You tube video on a dial up internet connection !). |
|