MQX: Is printf safe to be used from multiple tasks ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX: Is printf safe to be used from multiple tasks ?

Jump to solution
1,088 Views
robroz
Contributor III

Hi,

I guess it isn't - prints can get overlayed with printfs from other tasks, but would still like to confirm if I'm right or wrong..

Thanks,

Bulek

Tags (3)
0 Kudos
Reply
1 Solution
792 Views
JerryFan
NXP Employee
NXP Employee

The printf is not muti-task safe. Please see the code of _io_printf, please notice that no any sync method(sem, event, etc) used within it.  The call stack was listed to easy the code reading.

_io_printf -> _io_doprintf->_io_serila_poller_write.

View solution in original post

0 Kudos
Reply
1 Reply
793 Views
JerryFan
NXP Employee
NXP Employee

The printf is not muti-task safe. Please see the code of _io_printf, please notice that no any sync method(sem, event, etc) used within it.  The call stack was listed to easy the code reading.

_io_printf -> _io_doprintf->_io_serila_poller_write.

0 Kudos
Reply