+ 14
What is use of thread
4 odpowiedzi
+ 7
for running a code which does multiple things at once
imagine a program with one thread which makes some calculations,
while another thread is taking user input or doing something else
it makes better usage of your proccessors computation power by running in parallel
+ 6
In Android I did this to send a 'periodic action off into a future space/time'. The idea was that the main program works as if it had nothing else to do and then--every so often--the thread would come back, interrupt the main program and make something happen.
In addition to @Burey's 'parallel', this is 'asynchronous' (or even on-demand).
It's useful for API's, file system / critical event monitoring, performance timing, etc.
+ 2
Imagine you have to make many programs to run on parallel tracks.Here comes the use of thread where they helps to minimise the time consumption.For eg A program to display the conversation between two people.
+ 2
dividing a single program into smaller chunks so they can work independently at the same time and the chunk is called thread.also they can be used multiple times in the same program.