wood burning stoves 2.0*
The moose likes Threads and Synchronization and the fly likes why  thread is in running or runnable state why it is not terminated ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "why  thread is in running or runnable state why it is not terminated ?" Watch "why  thread is in running or runnable state why it is not terminated ?" New topic
Author

why thread is in running or runnable state why it is not terminated ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 688

hi well this is the server code i have coded this but i got this idea because of a book , but one thing is striking my mind and that is
when the click the button the print writer will flush the data to the client and a new thread is getting created ..but wait from here i cant understand whats happening
see the first time i click the button the data is send to the client and server starts a thread which is listening to the client so , as expected client will reply ..now server's listening thread is completed
after receiving the data from client ...... but
when i again send the message from the client why server's listening thread is still listening (i mean it is in running or runnable state and do back & forth between this two states)but the question is why the thread is not completed and go into terminated state why it is keep running ?



[edited for language]


The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Aditya Jha
Ranch Hand

Joined: Aug 25, 2003
Posts: 227

Firstly, I understand you must have been frustrated with the problem, but try not to use language which may seem inappropriate in such a forum.

Secondly, whenever a thread refuses to die, there are 2 situations to check for - 1) A never-ending loop, and/or 2) An IO block.

What do you think could be happening here?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why thread is in running or runnable state why it is not terminated ?
 
Similar Threads
threads concurrency problem
peer to peer client server program
Seems like I can't read from a scoket?
I need help improving this chat server and chat client!
How do you formally disconect a client from a server?