[riot-notifications] [RIOT-OS/RIOT] iotlab-m3: thread tests failing (#10800)
notifications at github.com
Fri Jan 18 12:19:30 CET 2019
To be pedantic about words. I would say that`printf/puts` are "thread safe", it is just normal to have mixed outputs if two threads print "at the same time". Like the first tests you do with threads on linux where you have mixed outputs.
Before it was quite unlikely to be de-scheduled during a printf as you were often the thread with the biggest priority but was still possible and shown in some tests with print on asynchronous events.
When using the DMA you are always de-scheduled.
(Now that I read the link from https://github.com/RIOT-OS/RIOT/pull/8619#issuecomment-405618940 maybe they are not thread safe but for me it is a different issue than the issue with the tests)
I would use more say not "atomic" as it is more the fact that even if you printed the first characters of the string, somebody else can print before you finish printing your string.
I think it is normal to assume that you can be de-scheduled during a printf and somebody else tries to print too.
What is not thread safe is our tests implementation as they do not take this possible de-scheduling into account. And even with a `thread safe` newlib, they would still they need to use a shared lock to ensure full string printing.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications