Reputation: 107
Each process can have multiple threads , but is it allowed that single thread can be shared among multiple processes ? I have confusion that i am relating this to tightly coupled multiprocessor where memory is shared among multiple processor.
In tightly coupled multiprocessor : memory is shared In loosely coupled multiprocessor : distributed memory
Correct me if i am thinking in wrong direction.
Upvotes: 2
Views: 2480
Reputation: 14668
Yes, you are right that accidentally you were thinking in wrong direction.
Now, to start with answer to your confusion, whether it tightly coupled or loosely coupled multi-core or single-core processor etc. etc., in Java a thread will belong to the same process for its life time.
You can take advantage of multi-core processors using Java's fork/join framework by using all available processors for thread execution. But in this case as well, whether a thread is being executed by one processor or other, thread will stick tightly to the process in which it started it life.
Upvotes: 3