aspose file tools*
The moose likes Beginning Java and the fly likes Process vs thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Process vs thread" Watch "Process vs thread" New topic
Author

Process vs thread

Tim Johnsen
Greenhorn

Joined: Oct 13, 2005
Posts: 12
What is the difference between the two? (Note this is not for class just curious as to what the difference is).

Thanks
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
Threads are more lightweight. You can have many threads in a process.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
To overgeneralize ...

Processes are started by the operating system. There is quite a bit of startup and teardown overhead. They offer good safety and isolation from each other, the downside of which is it's harder to make them communicate with each other.

Threads are managed by a program running in a process. They are lighter weight to startup and teardown, but is still non-zero overhead so you can do too many and drag things down. There are many neat language-specific ways for threads to communicate; Java has things like wait, notify, join built in and the whole new concurrent package to play with.

Those definitions of process and thread are not necessarily true on every platform and language. If you talk about them in a conversation and don't seem to be saying the same thing as the other person, back up and get agreement on what you really mean.
[ October 18, 2005: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Process vs thread