C
Chris
When I run a Java program on Linux, it spins off a large, random number of
processes. When I call ps -ef to show all processes, I get output like this:
<snip>
root 6920 6694 8 13:01 pts/6 00:00:00 java ShortWait
root 6921 6920 0 13:01 pts/6 00:00:00 java ShortWait
root 6922 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6923 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6924 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6925 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6926 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6927 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6928 6921 0 13:01 pts/6 00:00:00 java ShortWait
<snip>
Can someone explain why there are so many PIDs? Or maybe I don't understand
what a PID is.
The program I'm running above is just a simple class to demonstrate the
problem:
public class ShortWait {
public static void main(String[] args) throws Exception {
System.out.println("start");
Thread.sleep(10000);
System.out.println("end");
}
}
processes. When I call ps -ef to show all processes, I get output like this:
<snip>
root 6920 6694 8 13:01 pts/6 00:00:00 java ShortWait
root 6921 6920 0 13:01 pts/6 00:00:00 java ShortWait
root 6922 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6923 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6924 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6925 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6926 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6927 6921 0 13:01 pts/6 00:00:00 java ShortWait
root 6928 6921 0 13:01 pts/6 00:00:00 java ShortWait
<snip>
Can someone explain why there are so many PIDs? Or maybe I don't understand
what a PID is.
The program I'm running above is just a simple class to demonstrate the
problem:
public class ShortWait {
public static void main(String[] args) throws Exception {
System.out.println("start");
Thread.sleep(10000);
System.out.println("end");
}
}