This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Proposal to remove std stream and file chain info from reent struct
- From: Till Straumann <strauman at slac dot stanford dot edu>
- To: Jeff Johnston <jjohnstn at redhat dot com>
- Cc: "'newlib at sources dot redhat dot com'" <newlib at sources dot redhat dot com>, Joel Sherrill <joel dot sherrill at oarcorp dot com>
- Date: Thu, 17 Jun 2010 10:09:14 -0500
- Subject: Re: Proposal to remove std stream and file chain info from reent struct
- References: <4C192EE7.4010609@redhat.com>
Jeff.
I like the idea. However, you would still allocate (from the single
global chain)
one set of stdin/stdout/sterr streams per thread, right?
-- Till
On 06/16/2010 03:07 PM, Jeff Johnston wrote:
In light of the following post:
http://sourceware.org/ml/newlib/2010/msg00376.html
I am proposing to remove the std streams from the reentrancy structure
and have one global set. As well, the glue chain can also be removed
since we would always be using the one chain. I am proposing a new
global structure which would house the std streams and the glue chain.
The current std stream situation appears to be mostly historical. I'm
not sure anyone actually depends on there being std streams per
thread. POSIX thread and I/O behaviour certainly wasn't ever
considered in the initial implementation.
There are obvious benefits to doing this. The reentrancy struct gets
smaller. The scenario problem, described in the newlib posted link
above, goes away. In addition, the code gets simplified as some
reentrant versions of functions are not needed.
I am proposing this here first in case any platform has a dependency
on the current behaviour or there are some gotchas I haven't thought of.
If there are no fundamental objections, I will make the changes and
post a patch here for review/comments.
-- Jeff J.