3 ms·
You can create pthreads with manually allocated stack segments and resize them later. https://www.ibm.com/docs/en/zos/2.2.0?topic=functions-pthread-attr-setsta
by titzer 4y ago
You can create pthreads with manually allocated stack segments and resize them later.
https://www.ibm.com/docs/en/zos/2.2.0?topic=functions-pthread-attr-setstack-set-stack-attribute https://www.ibm.com/docs/en/zos/2.2.0?topic=functions-pthrea...
- telotortium 4y agoDoes that actually resize the stack in a way that the C runtime will recognize (e.g., add a guard page, making the stack size available to future calls of `pthread_getattr_get_np`)? I guess you'd only resize the stack yourself if your code was planning on somehow keeping track of the stack size, so I suppose it's not too big of a concern, but still.
- gpderetta 4y agoThe only way to resize the segment is mapping in pages at the end of the original stack, and that only works if you were careful and arranged for virtual space to be reserved and available at the end. And the only robust way to do that is to map something in. At that point might as well assign the space to the stack from the beginning. To