Tim,
> How can I determine how much stack size is left?
namespace hpx { namespace this_thread
{
// return the available stack space in bytes
HPX_EXPORT std::ptrdiff_t get_available_stack_space();
}}
This function is declared in
#include <hpx/runtime/threads/thread_helpers.hpp>
Note that this function may return
std::numeric_limits<std::ptrdiff_t>::max() on certain systems or if it's
called not on a HPX-thread.
HTH
Regards Hartmut
---------------
http://boost-spirit.com
http://stellar.cct.lsu.edu
>
>
> Best,
>
> Tim
>
>
>
> On 11/24/2016 01:41 PM, Hartmut Kaiser wrote:
> > Tim,
> >
> >> I'm still a bit confused about the different stack sizes you can
> specify
> >> (small, medium, large, huge).
> >>
> >> - Which size is relevant for what kinds of tasks/threads?
> > All tasks use the 'small' stack size if not otherwise specified.
> >
> >> - Is there a way to determine the exact size I need?
> > No. You can find out how much stack size is left, though.
> >
> > And yes, this is annoying. What we really need is a way for letting
> stacks
> > grow as needed (something Windows does by default). So far we have not
> been
> > able to find a way to achieve this in the general case.
> >
> >> - Do I really need to keep the size as small as possible anyway?
> > That depends on the number of (HPX-)threads you have active
> concurrently,
> > also on the type of machine you're running on. In the end it's a matter
> of
> > benchmarking to find out how much larger stack sizes impact your
> > applications performance.
> >
> > HTH
> > Regards Hartmut
> > ---------------
> > http://boost-spirit.com
> > http://stellar.cct.lsu.edu
> >
> >
> > _______________________________________________
> > hpx-users mailing list
> > [email protected]
> > https://mail.cct.lsu.edu/mailman/listinfo/hpx-users
>
_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users