• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Keep-Alive-Timer Thread

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I created a multi-threaded application where each thread posts an XML request to an HTTP server. I place each thread in a ThreadGroup. I noticed that when I poll the number of active threads in the ThreadGroup by using the actievCount() method, I always have one thread active. When I debug the thread and print the contents of the ThreadGroup at 500 ms intervals using the list() method I see my threads but after all my threads are finished and die, I see the following:
java.lang.ThreadGroup[name=requests,maxpri=10]
Thread[Keep-Alive-Timer:,8,requests]
This thread never dies. Does anyone know what this thread is and how it got placed in the ThreadGroup? This thread is not present when I have my threads still active. I am using JDK 1.3.1. Any help would be appreciated.
Thanks,
Steve
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Every thread group requires a monitor thread that maintains state information about the other threads in the group. So it's just running around in the group and checking on your worker threads.
It's generally not that efficient to create a group per working thread for that reason.
 
Steven Zaluk
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I have worker threads in the group this Keep-Alive-Timer thread is not there. It is only present when all my threads have finished executing.
Thanks,
Steve
 
Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic