aspose file tools*
The moose likes Threads and Synchronization and the fly likes Is it OK? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Is it OK?" Watch "Is it OK?" New topic
Author

Is it OK?

Ram Kas
Ranch Hand

Joined: Jul 26, 2006
Posts: 83
Is it ok to define thread as "process at JVM level"?
Kartik Patel
Ranch Hand

Joined: Sep 12, 2005
Posts: 73
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


Chop your own wood, and it will warm you twice. - Henry Ford
Ram Kas
Ranch Hand

Joined: Jul 26, 2006
Posts: 83
Thanks Kartik
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
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).


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
 
Consider Paul's rocket mass heater.
 
subject: Is it OK?