The Artima Developer Community
Sponsored Link

Java Answers Forum
Need help in killing thread

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Utpal Sapre

Posts: 1
Nickname: us
Registered: Dec, 2004

Need help in killing thread Posted: Jan 10, 2005 10:22 PM
Reply to this message Reply
Advertisement
Hi
I am developing a program which deals with graphic generation by reading a xpdl file (it’s a kind of xml file). For this, I am using an open source tool which does this job. I’ve modified its code to suit my need. The only problem remaining it that its basically a GUI tool which shows generated graphic using AWT. Because of this it starts many AWT related thread, please see the list below.

"DestroyJavaVM" prio=5 tid=0x00036948 nid=0xc78 waiting on condition [0..7fad8]

"TimerQueue" daemon prio=5 tid=0x00a09e98 nid=0x764 in Object.wait() [3d3f000..3d3fd8c]

"AWT-EventQueue-0" prio=7 tid=0x04097c60 nid=0xba0 in Object.wait() [3cff000..3cffd8c]

"AWT-Shutdown" prio=5 tid=0x02dc2d60 nid=0x5c4 in Object.wait() [380f000..380fd8c]

"Java2D Disposer" daemon prio=10 tid=0x02dbb190 nid=0xe60 in Object.wait() [36af000..36afd8c]

"AWT-Windows" daemon prio=7 tid=0x02d49d10 nid=0xeb0 runnable [326f000..326fd8c]

"Monitor Ctrl-Break" daemon prio=5 tid=0x02cce868 nid=0xa38 runnable [2fbf000..2fbfd8c]

"Signal Dispatcher" daemon prio=10 tid=0x0003f1a0 nid=0x824 waiting on condition [0..0]

"Finalizer" daemon prio=9 tid=0x009c0da0 nid=0x47c in Object.wait() [2b5f000..2b5fd8c]

"Reference Handler" daemon prio=10 tid=0x009bf970 nid=0xac8 in Object.wait() [2b1f000..2b1fd8c]

"VM Thread" prio=5 tid=0x009fb6f8 nid=0xea0 runnable

"VM Periodic Task Thread" prio=10 tid=0x009fd9c0 nid=0xcc0 waiting on condition

"Suspend Checker Thread" prio=10 tid=0x0003e858 nid=0x81c runnable

As "AWT-Shutdown" and "AWT-EventQueue-0" thread are non demon so my program doesn’t quit even after finishing its job. I some how need to destroy these threads so that my program can finish.

I can not use “interrupt” method of Thread class because it will throw java.lang.InterruptedException as these thread are in blocked state by calling wait() method of some object.

So all this description boils down to one single question,
“Is there any way to kill a blocked thread, either gracefully or abruptly?”
Or may be if any body can suggest some other solution to this problem.

Thanks and Regards
Utpal

Topic: Regular Expressions in WebSphere Previous Topic   Next Topic Topic: TRACERT

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use