I am new to the world of multithreading and deploying code on a server. I have a project that has a main thread. This main thread has a thread pool of 10 other threads that "query" different hardware using SNMP. Those threads then do some database stuff and that database goes to a webapp front end. The main thread uses a scheduler to keep the task running for ever and repeats every 15 seconds.
In eclipse I exported a runnable .jar and ran it on a server using "nohup java -jar nameOfJar.jar &". Now to kill this process I use "ps -ef | grep java" to see what PID the nameOfJar.jar is running on and use "kill PIDofNameOfJar" to actually kill the process. I am new to multithreading and am wondering what happens to the threads when I use the kill command. Is any clean up done on them? Or should I have code to deal with this? Or should I not be using the kill command to stop a runnable jar?
I am thinking that since I am killing the main process the other 10 threads will not be terminated if they have been sent out but I'm not sure.
Any help would be appreciated!