Thread-safeness of API functions

Joris van Rantwijk jorisvr at sron.nl
Fri Jul 30 16:33:31 UTC 2010


On Friday, July 30, 2010 17:41:34 Joel Sherrill wrote:
> For most of the reentrancy support, newlib uses a REENT
> structure which is context switched by RTEMS on a per-thread
> basis.  This covers most methods but not some FILE * AFAIK.

I could not figure out the REENT mechanism. If REENT is switched per 
task, is it not a problem when an ASR handler calls library functions 
concurrently with the main code?

> At this point, there is a PR to add this support and
> it has patches.  If you are interested in this, it would be
> a help to review and help shepherd the patches through
> the newlib and RTEMS projects.

Can you point me at the project? I'm not sure there is anything I can 
do, but I will look for something.

In any case thanks for your answers. Looks like I'm going to add a 
printf_mutex to my application.

> Picky stuff under the hood. :)

But this should not be under the hood. This is part of the definition of 
the API. There should be a "thread-safe/unsafe" dashboard light :)

Joris.



More information about the users mailing list