From: Bjorn Reese (breese_at_[hidden])
Date: 2020-05-22 11:54:23
On 2020-05-04 01:15, Andrzej Krzemienski via Boost wrote:
> There is a number of reasons people do not want to or cannot use the C++
> exception handling mechanism. One of them is that the implementation of
> exception handling requires the usage of TLS, and TLS is not implementable
> on some platforms, like GPUs. If Nvidia's compiler does not implement C++
> exception handling mechanism, it is not because it would be slow, but
> because it would require TLS support. From this perspective, if I cannot
> use C++ exceptions because of TLS and I have to use something else, then
> another TLS-based library is not really an alternative. In this case it
> does not matter that it is only IDs that are stored in TLS. The sole fact
> of even employing TLS is a deal breaker.
LEAF really only needs one thread-local pointer to the topmost context
per thread, so it may be possible to replace the thread-local storage
with a global lock-free hash table.
A lock-free hash table only requires atomic support, which is generally
available on GPUs and microcontrollers.
The key of the hash table could be the thread id. Task-based RTOS
systems could use its task handle instead.
An example of a lock-free hash table:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk