Optionally use thread-local objects for struct _reent members

Sebastian Huber sebastian.huber@embedded-brains.de
Thu May 19 08:49:38 GMT 2022


I just would like to give a short status update.

With the recent patches using _REENT_GLOBAL is no longer required. The 
global state of Newlib is managed by dedicated objects (for example the 
FILE object list or the exit handlers). This enables us to use 
thread-local objects for all members of struct _reent. We should have a 
patch ready for review soon.

It would help if we could make the _REENT_GLOBAL_STDIO_STREAMS option 
the default behaviour and remove the associated conditional code. It is 
currently enabled by Cygwin and RTEMS. I will send a patch to discuss 
this next week.

We didn't work on the support for constructors/destructors for 
thread-local objects yet, see:


My approach would be to first add a prototype implementation to Newlib 
using a dedicated linker set and then make a proposal for the ELF support.

embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:

More information about the Newlib mailing list