Reputation: 1809
I am trying to understand basic OS concepts
Want to know if my understanding is right multi-processing Example: I invoke A.exe on my machine. I invoke another instance of it again. So there would be two A.exe on the RAM which are called processes and the OS would do multi-processing between them by means of context switching and blah blah
Multi-threading Example: A.exe consitutes 2 things say program C and D . Assuming invoking A.exe means running C and D simultaneously. In that case 1. program A would call C and D as thread and span or start them as soon as A.exe is loaded. 2. C and D are threads and when process A.exe is given a chance to execute, only then multi-threading between C and D happens 3. C and D share the same process space alloted for A.
Is this correct?
Upvotes: 1
Views: 625
Reputation: 75615
Largely correct
Multi-threading allows the threads to share state easily - there is no 'memory protection' between the threads in the same process
Multiple processes does not allow threads to share state except explicitly e.g. by passing messages, sharing file handles or explicitly shared memory.
Upvotes: 2