stdio thread safety

Freddie Chopin freddie_chopin@op.pl
Tue Jun 4 19:03:00 GMT 2013


W dniu 2013-06-04 20:49, Carl Norum pisze:
> Yeah - I made some deeper reading of __sinit and __sfp as part of getting this stuff
> set up, and it looks like I might not need them after all, as you mention.  Each thread
> gets its own FILE structure for each of the standard streams, so the work buffers can't
> collide anyway.  I'm just a little apprehensive about it....

You don't need to have reent for each thread either, but - as usually - 
there are some things you MUST NOT do in that case.

I don't know what target are you working with, so I'm not sending any 
specific details, as these might be useless for you. My experience is 
specific to microcontrollers, which - because of small RAM amount - 
warrant such "tricks" that are far from "standard practice".

4\/3!!



More information about the Newlib mailing list