Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Threads

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is difference between processer and thread??
 
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean "process" and "thread", I guess.

The main difference is that processes are isolated from one another's memory, whereas threads share memory.

For more information, try foldoc.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The main difference is that processes are isolated from one another's memory, whereas threads share memory.



Specifically, in case of Java, a JVM, and what it runs is 1 process. So having two java processes mean having two JVMs (and two "java" entries in the process list / task manager).

A process can have several threads, which (as mentioned before) share memory. Also, in modern operating systems, the unit of scheduling is a thread, and not a process. That means, if there are two programs, one is running one thread, and the other running two, it is likely that the latter will get twice the CPU time as the former.
reply
    Bookmark Topic Watch Topic
  • New Topic