“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”
A process runs in its own address space. No two processes share their address space.
Threads will run in the same address space of the process that owns them. Threads belonging to the same process will run in the same address space. They will also share the process’s stack and heap. No two processes will share their stacks or their heaps.
Threads also have local storage which is not shared by the other threatd in the process. This is known as Thread Local Storage (TLS).
TLS does not need synchronisation mechanisms to be coded and is therefore far easier to use but it does tie object created on a particular thread to that thread for their entire duration.
Visual Basic makes heavy use of TLS and this is the main reason that objects created from VB should not be used outside Single Thraded apartments.
A process runs in its own address space. No two processes share their address space.
Threads will run in the same address space of the process that owns them. Threads belonging to the same process will run in the same address space. They will also share the process’s stack and heap. No two processes will share their stacks or their heaps.
Anyone got any more core differences?
Context switching in threads is less expensive as compared to processes
Thread is a piece of execution i.e., a program
Process is a combination of Threads.
Threads also have local storage which is not shared by the other threatd in the process. This is known as Thread Local Storage (TLS).
TLS does not need synchronisation mechanisms to be coded and is therefore far easier to use but it does tie object created on a particular thread to that thread for their entire duration.
Visual Basic makes heavy use of TLS and this is the main reason that objects created from VB should not be used outside Single Thraded apartments.
Leave an Answer/Comment