This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

The thread model in newlib


I'm trying to use GCC + newlib for my OS (RDOS, http://www.rdos.net/rdos). I did try to
do a port 2002, but as I've studied my sources it turns out the patches for thread / reentrance
support were quite ugly.


RDOS only runs on i386, so portability is not a concern. I already have a working environment
with BCC 4.52 + TD32, which works since a couple of years ago. However, I like the open
environment better, and Borland no longer develops this compiler. With PE-executables, the
thread issue has a rather elegant solution for i386. You simply load a segment register (FS in
the case of PE), and let each thread have it's own selector. This way it is easy to implement
TLS and provide each thread with it's own data. It doesn't seem like it is easy to implement
this in newlib, at least not in version 1.10. I would rather only implement the non _r function-calls.
There is no need to provide an extra parameter, especially since every function call in RDOS
is reentrant. However, it is essential that the run-time library also is reentrant.


Any suggestions?

Regards,
Leif Ekblad



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]