Thread-Local Storage, C++ Support and SMP

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 4 07:23:27 UTC 2013


Hello,

we added support for thread-local storage on PowerPC for C11 and GCC __thread. 
  The work on C++11 support revealed a couple of problems.

1. The general C++ support code is not SMP safe.  It uses task variables and 
disables preemption to ensure mutual exclusion.

2. The implementation of thread keys in the C++ support is not standard 
conform.  The destructors must be called during thread exit and cancellation.

3. The implementation of POSIX keys is not standard conform.  The destructors 
must be called during thread exit and cancellation.

4. The workspace estimate for POSIX keys is wrong.  It depends on the maximum 
thread count in the system times the maximum key count.

5. The POSIX keys are broken if someone uses unlimited thread objects.

To address the C++ problems we propose:

1. Move the POSIX keys to the Classic API.

2. Implement the POSIX keys with the red-black tree instead of the fixed table 
lookup.

3. Fix the configuration issues.

There was a GSoC project in 2012 for this which addressed parts of the above 
issues.  Where can I find the latest status of this project?

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list