Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ExecutorService is causing the program to hang for few minutes

Michael Henderson
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote this simple program to learn how to use Poison Pill pattern to terminate threads. It runs to completion but after all the threads are done processing, the application hangs for few minutes before exiting code 0.

I've included the jstack output at the end. I had originally written this program to use Thread and Runnable and it worked perfect, ie, without hanging for few minutes before exiting. Any help or hint is appreciated.
thank you

jstack output is

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic