UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 22349

7.1i EDK, RTOS - Concurrent use of sprintf, printf, fprintf, and malloc hangs the system

描述


General Description:

I have two threads; both of them use the sprintf( ) function. When I run my system, it hangs. Why is this occurring?

解决方案

The C library is not thread-safe/re-entrant when used with Xilkernel. A lockup is quite possible and will happen with concurrent usage of sprintf, printf, fprintf, malloc, etc. For this reason, use of these functions must be protected with synchronization primitives.

AR# 22349
日期 04/06/2011
状态 Archive
Type 综合文章
的页面