Iam using Red Hat Linux 7.3 and j2sdk 1.4.2_03 in my system.
I executed the below java program.
My java code:
public class chkprg
{
public static void main(String args[])
{
try
{
Thread.currentThread().sleep(2000);
System.out.println("some string");
}catch(Exception e)
}
}
while executing this code,i checked the number of java processes using ps command.It showed me eight for about 2 seconds and then to zero after the program quits by printing "some string".
If iam correct,In native thread implementation,each thread is showed as a separate process in the process table.
Then why is it spawning eight processes for just a single main thread?
I tried with some other versions of java(jdk 1.4.0 and 1.4.1_07).I got the same results.
can somebody clear my doubt?
I need a solution immediately please.
thanks in advance
regards
mira.
I executed the below java program.
My java code:
public class chkprg
{
public static void main(String args[])
{
try
{
Thread.currentThread().sleep(2000);
System.out.println("some string");
}catch(Exception e)
}
}
while executing this code,i checked the number of java processes using ps command.It showed me eight for about 2 seconds and then to zero after the program quits by printing "some string".
If iam correct,In native thread implementation,each thread is showed as a separate process in the process table.
Then why is it spawning eight processes for just a single main thread?
I tried with some other versions of java(jdk 1.4.0 and 1.4.1_07).I got the same results.
can somebody clear my doubt?
I need a solution immediately please.
thanks in advance
regards
mira.