[argobots-discuss] externally allocated stacks and unnamed (detached) threads
Phil Carns
carns at mcs.anl.gov
Wed Nov 17 16:14:48 CST 2021
Hi all,
We've been thinking about some memory optimizations for which it might
be easier if our own code provided the stack memory for newly created
ULTs so that we have full control over the allocation strategy. This
seems pretty straightforward with the ABT_thread_attr_set_stack() function:
https://www.argobots.org/doxygen/latest/d2/df6/group__ULT__ATTR.html#gac8f39be20d677898c45293c5ce31eea0
However, our use case often creates unnamed (detached) threads by
setting the ABT_thread_create() newthread argument to NULL. I can
elaborate if needed, but the short story is that this is a really
natural fit for RPC handlers in our model:
https://www.argobots.org/doxygen/latest/d0/d6d/group__ULT.html#ga73bd1f04ce57def336cb20cdec9b14bd
Is it possible to do both (provide an externally managed stack pointer,
and use unnamed ULTs)? From the documentation it looks like the answer
is probably no, because the caller who created the stack allocation
doesn't explicitly free the ULT, and thus doesn't have a way to free the
stack after the ULT is complete.
I wanted to double check though before I start thinking about
alternatives, though.
thanks!
-Phil
More information about the discuss
mailing list