3 ms·
Go certainly does not do traditional threading. It has Go routines, which is are lightweight "threads" which gets multiplexed on top of real OS threads. It's ba
by ecnahc515 10y ago
Go certainly does not do traditional threading. It has Go routines, which is are lightweight "threads" which gets multiplexed on top of real OS threads. It's basically implementing async IO at the runtime level.
- stymaar 10y agoIn term of programming interface, you deal with them as if it was a traditional thread. (with its pro and cons: pro: all your code is sequential, it's intuitive to understand what the programmer wanted to do in a specific scenario. cons: data-races are hiding in every corners :/) Being a green thread with a growing stack is an implementation detail for the developer writing Go code.
- fooyc 10y agoIn a thread, every single function call is not a separate thread. In async, every single function must be async (or be super fast and i/o-free).