Linked Questions

0 votes
1 answer
154 views

Possible Duplicate: Get a List of all Threads currently running in Java This is just for testing purposes - not production UI Is it possible to set something like a button on my Application's ...
jkteater's user avatar
  • 1,391
0 votes
0 answers
56 views

I need to read the threads generated by other programs, which are running in the same JVM. I used the following code: long a[] = ManagementFactory.getThreadMXBean().getAllThreadIds(); ThreadInfo[] ...
JoeJoe's user avatar
  • 93
91 votes
9 answers
27k views

I've read and re-read Java Concurrency in Practice, I've read several threads here on the subject, I've read the IBM article Dealing with InterruptedException and yet there's something I'm simply not ...
SyntaxT3rr0r's user avatar
  • 28.4k
54 votes
8 answers
29k views

If I create my own thread (i.e. not a threadpool) and somewhere I call sleep or any other interruptible method, is it ok to ignore the InterruptedException if I know nobody else in the code is doing ...
Hilikus's user avatar
  • 10.4k
24 votes
12 answers
14k views

Though I know it'll be a bit silly to ask, still I want to inquire more about the technical perspective of it. A simple example of an infinite loop: public class LoopInfinite { public static ...
big zero's user avatar
  • 620
21 votes
8 answers
28k views

Is it possible to print the thread name in the log statements generated by java.util.logging.Logger? One alternative is to do something like the following: logger.info(thread.getName() + " some ...
Majid Alfifi's user avatar
35 votes
4 answers
28k views

Hypothetical scenario: I have a daemon thread responsible for some I/O, the main thread finishes and returns, and the JVM decides to terminate my daemon thread. How does it do so? Interrupt? Finalize?...
Aaron J Lang's user avatar
  • 2,118
10 votes
2 answers
30k views

I'm using a library that creates its own thread and it throws an exception. How can I catch that exception? The exception is thrown on the line marked below: ResourceDescriptor rd = new ...
yuejdesigner85's user avatar
6 votes
7 answers
596 views

I read below from the book < Core Java vol. 1 >: Every Java application starts with a main method that runs in the main thread. In a Swing program, the main thread is short-lived. It ...
smwikipedia's user avatar
7 votes
3 answers
3k views

Is it possible to write Thread creation listener in java? For example using aop?! I mean something like this that if my application creates a thread I would like to register this object in my own ...
Łukasz Rzeszotarski's user avatar
0 votes
4 answers
5k views

I would like to close all threads that are running (if there are) when my main method is called. public static void main(String[] args) throws Exception { // Close all thread except current one .....
Nans's user avatar
  • 156
2 votes
1 answer
5k views

In dropwizard, I need to implement asynchronous jobs and poll their status. I have 2 endpoints for this in resource: @Path("/jobs") @Component public class MyController { @POST @Produces(...
me1111's user avatar
  • 1,157
7 votes
3 answers
1k views

I have an app where when a "game" stats, it starts a couple different threads. I start the threads like so: Thread thread = new Thread(new Runnable() { public void run() { //... } ...
John's user avatar
  • 3,807
3 votes
2 answers
7k views

You can find the maxThreads limitation is 350 in below server.xml. Then, I use below command to check current java pid $ps uax | grep tomcat ruyi 25802 0.0 0.0 10436 420 ? Ss ...
Yuwen Yan's user avatar
  • 4,965
2 votes
3 answers
3k views

I asked a question about how to override the default Java Exception handling here and was told the answer here. The question is now : is there a way to generify this handler to all threads without ...
Benj's user avatar
  • 1,204

15 30 50 per page