IntelliJ Java IDE
The moose likes Threads and Synchronization and the fly likes ExecutorService Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "ExecutorService" Watch "ExecutorService" New topic
Author

ExecutorService

Timmy Ryan
Ranch Hand

Joined: Dec 09, 2007
Posts: 63

I have a program which creates an ExecutorService object with Executors.newSingleThreadScheduledExecutor()
I then submit two jobs to this using scheduleWithFixedDelay method.
The first task checks some value in the registry using com.ice.jni.registry and the second runs some commands with commons.exec

If I run the program with the two jobs together if freezes after about two cycles.
If I run the program with either of the jobs running on there own the program runs fine.
There is no common code between the two jobs.

How do I go about debugging this problem?

If I create another thread which is separate to the ExecutorService it stops running as well when the ExecutorService freezes.
Aditya Jha
Ranch Hand

Joined: Aug 25, 2003
Posts: 202

Run it on Debug mode in some IDE like Eclipse. Then, once the application is frozen (as reported in your comment), pause the relevant threads and check their call stack. This should give you an idea about any possible deadlocks.
 
 
subject: ExecutorService
 
Threads others viewed
Execution freezes
Java swing background execution
Process completes and abruptly stops its threads?
JApplet System Access
Methods for threads?
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture