Newlib/Send string over UART with multiple threads cuts string of thread with lower priority #10495
Labels
Area: drivers
Area: Device drivers
Area: network
Area: Networking
State: stale
State: The issue / PR has no activity for >185 days
Description
If two threads with different priorities try to write a string over UART using Ethos, the string of thread with lower priority will be cut.
[EDIT]
As I show below with uart-thread-mutex_pb_simple, the problem does not come from Ethos.
If you enable mutex in main.c, output is good. If you use only mutex in stdio_uart.c, string are cut.
Between these two calls, it is newlib? Am I right?
Is newlib and printf thread safe?
Steps to reproduce the issue
Checkout my branch: https://github.com/biboc/RIOT/tree/uart_mutex_thread_pb
And run example uart-thread-mutex_pb_BR on samr21-xpro (make flash BOARD=samr21-xpro)
OR
Run example uart-thread-mutex_pb_simple on samr21-xpro (make flash BOARD=samr21-xpro)
My problem first appeared on STM32F4 as a Border Router, I didn't try the example above on this board but it should behave the same.
Expected results
The string of thread with lower priority should be fully printed before other thread can print string
Actual results
Output from example uart-thread-mutex_pb_BR :
Output from example uart-thread-mutex_pb_simple :
Versions
Ubuntu 16.04 and RIOT master (28/11/2018)
The text was updated successfully, but these errors were encountered: