This is the mail archive of the newlib@sources.redhat.com 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]

[RFC]: Thread safety in __sfp and atexit


The list operations in __sfp and atexit are not thread safe AFAICS.

This could be avoided by using a mutex or atomic instructions when a FILE pointer is acquired or an atexit function is added.

The problem hereby is that such a mutex should be created on newlib initialization (_REENT_INIT on the _impure_ptr for example), but there might be better locations.

Doing list insert with atomic instructions on the other hand is easy on i86 (i486 and above) but might be a problem on other platfomrs.

Comments are welcome.

Thomas


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