This is the mail archive of the
mailing list for the newlib project.
Re: stdio thread safety
- From: Freddie Chopin <freddie_chopin at op dot pl>
- To: newlib at sourceware dot org
- Date: Tue, 04 Jun 2013 21:03:39 +0200
- Subject: Re: stdio thread safety
- References: <581E2882-C47A-43B3-9CBB-748F86EEE7F1 at lytro dot com> <20130604082112 dot GA28282 at calimero dot vinschen dot de> <4F60FE24-4413-49D8-8D87-894080CA6178 at lytro dot com> <51AE2BD5 dot 1060204 at op dot pl> <1BDB6943-7636-43C7-A481-2EEBA4ED846F at lytro dot com> <51AE2DBD dot 7050800 at op dot pl> <C3BCF918-9D79-40F2-B469-72775B026EF8 at lytro dot com> <51AE325A dot 3030401 at op dot pl> <A22E9E1A-CEAF-4397-A48E-FD44461C12EB at lytro dot com>
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".