This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Threads vs Process  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
  I am reading about threads and I am confused could you please enlighten me with this.

  According to what I read "process" is consist of a multiple threads. Can we call a single threaded as a process? I saw this while reading a book.
"A process is a group of associated threads that execute in the same, shared environment. It follows, then, that a single-threaded process is one that contains exactly one thread, whereas a multi-threaded process is one that contains one or more threads."

Could you please also explain to me the difference of thread vs process, I read about that but it doesn't seem to sync in my brain.

Thank you.
 
Ranch Hand
Posts: 62
5
Eclipse IDE Java Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rhea Camille wrote:Could you please also explain to me the difference of thread vs process


A process is an instance of a computer program (which is an application installed somewhere on your machine). If you have e.g. Ms Win, locate the shortcut to the "Notepad". Notepad is an application. If you launch Notepad you have a process, an instance of Notepad. Launch again Notepad and you have *another* process.

A thread is a "flow of execution". It is the sequential execution of some code using a single processing unit (on modern CPUs a certain "core").

A process has at least one thread but may have more. All threads share the same memory address space of the process. Threads are normally scheduled by the Operating System.

Hope I have cleared your doubts. ;)
 
Rhea Camille
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Andrea for clearing that out

Cheers!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!