• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it OK?

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it ok to define thread as "process at JVM level"?
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it depends on the implementation of your JVM.
If JVM is implemented as many to one model than one can define threads as process at JVM level.
If JVM is implemented as many to many or one to one than one can't define it as process at JVM level.

For further information on type of Models implemented for MultiThreading
Search google with keyword multithreading model
 
Ram Kas
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Kartik
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dinakar Kasturi:
Is it ok to define thread as "process at JVM level"?



In disagreement with a previous poster, I would say that this is never a good analogy. Not for an application programmer, anyway.

Processes provide isolated execution environments. One process cannot directly access the data or code of another process. When writing code for a process, you do not have to worry that some other process will modify your data, or call your code, under your feet.

Threads provide parallel execution within a single environment. All the threads can access the same data and code. When writing code for multiple threads, you must always be aware of the possibility of other threads accessing your data and code.

This difference is so important to how you program for threads, compared to processes, that it completely invalidates your "definition", in my opinion.

For a system programmer (someone writing the code that implements threads and processes), I think there are greater similarities between threads and processes. Some operating systems have been known to call threads "Light Weight Processes" (LWPs).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic