• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • paul wheaton
  • Paul Clapham
Saloon Keepers:
  • Piet Souris
Bartenders:

thread implementation in linux

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic