Forums Register Login

thread implementation in linux

+Pie Number of slices to send: Send
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.
The knights of nee want a shrubbery. And a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 585 times.
Similar Threads
java threads implementation in linux
Multiple instances of java class
destroy() does not stop Process object
Process type
Running system commands
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:01:42.