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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,087 次查看
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

标记 (3)
0 项奖励
回复
1 解答
791 次查看
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 项奖励
回复
1 回复
792 次查看
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 项奖励
回复