C++ exceptions: pthread key allocation error for __gthread_key_create

Chris Johns chrisj at rtems.org
Tue Dec 6 00:25:56 UTC 2016


On 05/12/2016 18:19, Sebastian Huber wrote:
> On 05/12/16 07:57, Chris Johns wrote:
>> Is it the user who needs to account for the gthread key if using C++?
>
> Yes, its up to the user to ensure that there are enough POSIX keys
> available. This is quite a pain.

It is also error prone and silent and this is a real concern because it 
exposed very real issues if not correctly configured. The libstdc++ is 
fragile in this regard.

>
> Why is no TLS value used (instead of the POSIX key)?
>

I do not know. It is wrapped by our gthread wrapper.

> It would be possible to make the pthread_key_t self-contained, however,
> for the thread-specific value you need some system provided storage
> (currently the workspace).

I do not know what this means.

Chris



More information about the devel mailing list