Opened 5 years ago

Closed 5 years ago

#13220 closed Bugs (fixed)

windows thread stack size problem

Reported by: hjing huang <huangjingyf@…> Owned by: viboes
Milestone: Boost 1.66.0 Component: thread
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:

Description (last modified by viboes)

bool thread::start_thread_noexcept(const attributes& attr)
    {
new_thread=_beginthreadex(attr.get_security(),attr.get_stack_size(),&thread_start_function,thread_info.get(),CREATE_SUSPENDED,&thread_info->id);
    }

If the STACK_SIZE_PARAM_IS_A_RESERVATION attribute is not set in createthread, stack size does not take effect

Change History (6)

comment:1 by viboes, 5 years ago

Description: modified (diff)
Owner: changed from Anthony Williams to viboes
Status: newassigned

Please, could you elaborate? Do you have a concrete example that doesn't works?

comment:2 by anonymous, 5 years ago

Oh, I see. I need to set dwCreationFlags to STACK_SIZE_PARAM_IS_A_RESERVATION in CreateThread.

Thanks for reporting this issue.

comment:3 by viboes, 5 years ago

Milestone: To Be DeterminedBoost 1.66.0

comment:5 by hjing huang <huangjingyf@…>, 5 years ago

The default stack size (1M), win32 can start the number of threads is about 1400 or so, set the stack size of 256K, the number of threads that can be enabled should be far greater than 1400, but the actual test found inaccurate, set STACK_SIZE_PARAM_IS_A_RESERVATION only after Achieve the expected results.

comment:6 by viboes, 5 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.