avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] WIN-AVR floating point lib thread safe


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] WIN-AVR floating point lib thread safe
Date: Thu, 15 Apr 2004 10:08:07 +0200 (MET DST)

"E. Weddington" <address@hidden> wrote:

>> Is the floating point library in WINAVR thread safe?

> The floating point library is a part of avr-libc and IIRC I haven't
> seen any assertion that says that avr-libc is thread safe at
> all. Perhaps one of the developers (Joerg or Ted) can comment on
> this as well.

There has only been limited effort on thread-safeness made so far.  I
think there's a strtok_r() function to be used as a thread-safe
replacement for strtok().  Most standard C library functions don't
keep local state (and when they do, that's normally obvious).

stdio is completely thread-unsafe (the implementation keeps a lot of
local state, starting with the file handle table), but I guess whoever
thinks about threads will be running some kind of OS, so is likely to
have their own implementation of stdio anyway.  Adding thread-safety
to it by default will heavily bloat it further (and it's already huge
as it is now).

As far as the FP lib goes, I think nobody has analyzed whether it
stores local state somewhere.  Most of it is written in assembler, and
while it probably doesn't use static storage, they are doing a lot of
trickery so I guess a definative answer cannot be obtained without an
in-depth analysis of the code (which simply needs one resource: a
volunteer).
-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]