Explain different way of using thread? :

The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, ’cause when you are going for multiple inheritance..the only interface can help

Showing Answers 1 - 2 of 2 Answers

aStopBy

  • Sep 28th, 2007
 

Ways of using threads:
1) When an object has to be notified by other objects.
2) Multiple logic/computations are required to run concurrently. (wait/sleep/notify stage is not required if no shared resources)
3) Run it as?an usual method (only one thread is running and performing a finite sequence of codes)?
4) When a process has to deal with multiple requests/actions. (server/ one-to-many)
5) When a bunch of objects have to deal with multiple requests/actions from each other. (many-to-many)
6)... you name it....
7) When you want to create a deadlock.. (Ask if you do not know how)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions