I try to understand the basics of concurrent programming in Go. Almost all articles use the term "address space", for example: "All goroutines share the same address space". What does it mean?
I've tried to understand the following topics from wiki, but it wasn't successful:
- http://en.wikipedia.org/wiki/Virtual_memory
- http://en.wikipedia.org/wiki/Memory_segmentation
- http://en.wikipedia.org/wiki/Page_(computer_memory)
- ...
However at the moment it's difficult to understand for me, because my knowledges in areas like memory management and concurrent programming are really poor. There are many unknown words like segments, pages, relative/absolute addresses, VAS etc.
Could anybody explain to me the basics of the problem? May be there are some useful articles, that I can't find.
Golang spec:
"Address space" is a generic term which can apply to many contexts:
Dave Cheney's presentation "Five things that make Go fast" illustrates the main issue addressed by having goroutine within the same process address space: stack management.
Dave's qualifies the "address space", speaking first of thread:
(so this is about memory)
Then Dave illustrates the stack within a process address space (the addresses managed by a process):
See also "What and where are the stack and heap?".
The issue:
With threads, that can lead to restrict the heap size of a process:
goroutine uses a different approach, while still sharing the same process address space:
Go 1.3 introduces a new way of managing those stacks:
When you application runs on the RAM, addresses in RAM are allocated to your application by the memory manager. This is refered to as address space.
Concept:
Reading your post i can empathize. The terms you mentioned will become familiar to you as program more and more.
I first encountered these terms from the operating systems book, a.k.a the dinosaur book.
Hope this helps you.