Forums Register Login

Identify Long running threads

+Pie Number of slices to send: Send
Hello,

I've a requirement where I need to raise an exception when a thread is running for more than expected time. How to do this?

Thanks,
Raj Mohan
+Pie Number of slices to send: Send
If they're all threads created by your code can you do them via a pool in which case that's a good place to add the timing code ie store that start times and expected execution times and then set up either a background thread to poll them or a timer to execute on the soonest expected completion time.
+Pie Number of slices to send: Send
how about using Thread.yeild()?
My first bit of advice is that if you are going to be a mime, you shouldn't talk. Even the tiny ad is nodding:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1175 times.
Similar Threads
cant use exec() method to run java file
NX: Shutting Down the Server
Always Negotiate salary?
FileChannel and thread safety
Schedule a servlet in WAS 5
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:04:37.