Opened 6 years ago

Last modified 6 years ago

#12416 assigned Feature Requests

Windows: shared_mutex::state_data exceptions thrown in synthetic tests

Reported by: Tomer Gal <Tomer.Gal@…> Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

Hi, My name is Tomer Gal.

We have created synthetic benchmarks in which we create many threads. This causes shared_mutex to throw an exception when it has more than 2047 waiting threads due to the following limits:

struct state_data {

unsigned shared_count:11,

shared_waiting:11, exclusive:1, upgrade:1, exclusive_waiting:7, exclusive_waiting_blocked:1;

Obviously, creating more than 2047 threads waiting for a lock is too much for 'normal' code... however, the boost library shouldn't be the limiting factor for such a usage in my opinion.

The state_data is currently limited to the size of(long) which is 32 bits, and it looks like it could be increased to 64 bits.

Could this be fixed?

Regards, Tomer Gal, CTO at OpTeamizer

Change History (5)

comment:1 by viboes, 6 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned
Summary: shared_mutex::state_data exceptions thrown in synthetic testsWindows: shared_mutex::state_data exceptions thrown in synthetic tests

Hi, I'm unable to test this on Windows. Could you provide a github PR?

comment:2 by Tomer.Gal@…, 6 years ago

Hi, This issue is readable in the code: state_data::shared_waiting:11 - There is an 11 bits counter for the amount of waiting threads. This represents a max value of 2047 waiting threads, if this limit overflows, boost throws an exception.

Yes, I will find the time to issue a PR.

Regards, Tomer Gal (OpTeamizer)

comment:3 by viboes, 6 years ago

Thanks, the first implementer of Boost.Thread believed surely that this was enough.

comment:4 by viboes, 6 years ago

I believe it is not worth fixing this issue, as having 2047 sharing some resource is not a real issue.

I proposes to document this restriction on the documentation.

comment:5 by viboes, 6 years ago

Type: BugsFeature Requests
Note: See TracTickets for help on using tickets.