• 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:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Process and Thread

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

What is the difference between process and thread in java.How to have different processess in a java code.



Thank you.


 
author and iconoclast
Posts: 24208
47
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sannuth kashikar wrote: How to have different processess in a java code.



A process is, more or less, the same as a program or application.

"A Java code with different processes" could only mean multiple copies of the JVM -- i.e., launching java.exe multiple times.
 
sannuth kashikar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the use of java.lang.Process class.How useful is this ?
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24208
47
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sannuth kashikar wrote:What is the use of java.lang.Process class.How useful is this ?



It's part of Java's machinery for launching other programs. It's useful to the extent that you ... need to launch other programs!

You don't create Process objects yourself. If you launch a program with the Runtime.exec() methods, or the ProcessBuilder class, then you will get a Process object that you can use to keep track of the running program.
 
Sheriff
Posts: 22907
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A Process object is good for only a few things:
- interaction with the process using the input, output and error streams
- terminating the process
- waiting for the process to finish before doing anything else
- retrieving the exit code of the process

That's why there are only methods for these operations.
 
reply
    Bookmark Topic Watch Topic
  • New Topic