This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: Newlib thread features.
- To: Fabrice Gautier <Fabrice_Gautier at sdesigns dot com>
- Subject: Re: Newlib thread features.
- From: "J. Johnston" <jjohnstn at cygnus dot com>
- Date: Mon, 17 Sep 2001 15:15:07 -0400
- CC: "'newlib at sources dot redhat dot com'" <newlib at sources dot redhat dot com>
- Organization: Red Hat Inc.
- References: <B1F6452C89AFD411AE0800A0CC734C2301509E@EMAIL1> <3BA2C0AD.90BE42A1@sdesigns.com>
Fabrice Gautier wrote:
>
> Hi again,
>
> Does anybody has an answer for my question ?
>
> Fabrice Gautier wrote:
> >
> > Hi,
> >
> > I would like to know if Newlib has thread support and/or if it is thread
> > safe.
> > It would like for use with uClinux.
>
> Thank you.
>
> --
> Fabrice Gautier
> Fabrice_Gautier@sdesigns.com
Newlib is not fully thread-safe. It has special versions of routines that can be
used to create a thread-safe program. These are the _r routines which take an additional
parameter which is the reentrancy structure for that thread. A program must create
a separate reentrancy structure per thread.
One unprotected area is I/O. A program must take responsibility for protecting all
access to files. In the case of storage allocation and environment variables, special
mutex calls are made but the code for the mutex locks is generally not provided for
most platforms. If you code these routines, then the two areas are subsequently protected.
-- Jeff J.