I wrote a program that has to process any files that are put in a specified folder.

I would like to keep track of those threads, though, preferably via some sort of process id or something. is there any way that I can get a list of the threads that are currently alive?

I dont assign the threads names, because there can be anything from 0 to 20 threads at a time.

Help would be very much appreciated.

I can also supply the code that I wrote, if needed.

Take a look at the documentation for the following methods:

Thread.activeCount();
Thread.enumerate(Thread[] list);
Thread.getId();

Hope this helps.

Take a look at the documentation for the following methods:

Thread.activeCount();
Thread.enumerate(Thread[] list);
Thread.getId();

Hope this helps.

It did, thank you :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.