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

Description


General Description:

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

Solution

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
Date Created 09/04/2007
Last Updated 04/06/2011
Status Archive
Type General Article