Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why this programme doesn't terminate automatically?

 
Tushar Goel
Ranch Hand
Posts: 931
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was reading an article https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/?subscribe=success#blog_subscription-2
on Future object. When i am trying to execute the programme as mentioned in the article, programme is not terminating as it own. Article author also used
System.exit(0) in the end to terminate it. I am unable to understand this. any idea?

 
Campbell Ritchie
Marshal
Posts: 52621
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for “beginning”. Moving discussion.
 
Henry Wong
author
Sheriff
Posts: 22542
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Your thread pool has three user threads. These threads need to terminate before the JVM can exit on its own. You need to shutdown the executor.

Henry
 
Tushar Goel
Ranch Hand
Posts: 931
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yeah.. it works.. Thanks for the help..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!