Question: I was trying to understand what is the difference between process and thread and I understood all the important points but I was not able to understand this line:

> 
> The typical difference is that threads (of the same process) run in a
>  shared memory space, while processes run in separate memory spaces.
> 
> 
> 

Here is the [reference](https://stackoverflow.com/a/200473/663148).

Can anyone help me understand what does memory space means here? And what does above line means in layman terms so that I can understand?

Answer: 
memory space is like a boundary. An isolation to not to overstep, overwrite each other hence processes cannot access each other's variable etc.,hence have to use IPC to communicate to each other. But threads can access global variables (typically use some kind of protection like mutex when reading writing ).

```
Assume ( T = Thread, P = Process, and V = variable ) 
P1 
global_var
T1 
  can set global_var = 2
T2 
  can read global_var
  and can ever reset global_var

P2
  It cannot read P1::global_var

```

Hope this helps!
By "memory space", they mean the mapping of addresses to contents. So, for example, in two different processes, the contents of the same address may be different because they have different memory spaces.