D'awesome double sauce! Both Ali and Steve are not only very talented programmers but really nice guys and very approachable - they have always been super helpful on the Dlang forum!
At 45:25 of Ali's talk, he mentions A's stack and B's stack. When greetMoon is spawned, does that mean a stack C is created? Is there a stack per thread? How about a stack per core? Are these physical stacks or virtual stacks? My head is spinning but in a good way.
Correct, each thread has its own local stack space. 50 threads (i.e. 50 calls to spawn) mean 50 individual stacks would be allocated. I believe a heap allocation is made for each thread to otherwise manage the stack.
It's the same in every language. At runtime each core has a stack assigned, and this can be modified. each thread has memory assigned for it's stack, and when that thread is executed by a core then the stack pointer is set to the correct value before your code gets executed.
Thanks Mike, I've learned some new things feom Ali and Steve
Cheers!
D'awesome double sauce! Both Ali and Steve are not only very talented programmers but really nice guys and very approachable - they have always been super helpful on the Dlang forum!
100% both of them are awesome members of the community 🙂
...and also on Discord
@@bsdooby Absolutely!
At 45:25 of Ali's talk, he mentions A's stack and B's stack. When greetMoon is spawned, does that mean a stack C is created? Is there a stack per thread? How about a stack per core? Are these physical stacks or virtual stacks? My head is spinning but in a good way.
Correct, each thread has its own local stack space. 50 threads (i.e. 50 calls to spawn) mean 50 individual stacks would be allocated. I believe a heap allocation is made for each thread to otherwise manage the stack.
A stack per core would not work because the very low number of cores are working for a very high number of threads.
It's the same in every language. At runtime each core has a stack assigned, and this can be modified. each thread has memory assigned for it's stack, and when that thread is executed by a core then the stack pointer is set to the correct value before your code gets executed.
Finally, I know how to pronounce Schveighoffer. :)
lol except it’s not right. But I’m used to it.
Nice.