• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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

 
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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]
 
Ranch Hand
Posts: 227
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic