3 ms·
I wonder how hard it would be to try handle the segfault and allocate stack space on demand for these “threads”. Almost certainly stupid but a fun experiment to
by thornjm 6y ago
I wonder how hard it would be to try handle the segfault and allocate stack space on demand for these “threads”. Almost certainly stupid but a fun experiment to see if its possible...
EDIT: found a nice example of this here: https://rethinkdb.com/blog/handling-stack-overflow-on-custom-stacks/ https://rethinkdb.com/blog/handling-stack-overflow-on-custom...
- loeg 6y agoThe kernel does this for you, generally. You could use a segfault handler, stack probing, and a guard page to figure out when you're out of stack, but it's not clear how you grow the C stack if you're out of contiguous virtual address space.