Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9178901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:39:49+00:00 2026-06-17T17:39:49+00:00

Has any one ever written a multi-threaded C++ application for MicroBlaze? The Xilinx documentation

  • 0

Has any one ever written a multi-threaded C++ application for MicroBlaze? The Xilinx documentation states that:

The standard C library provided with EDK is not built for a multi-threaded environment. STDIO functions like printf(), scanf() and memory management functions like malloc() and
free() are common examples of functions that are not thread-safe. When using the C library
in a multi-threaded environment, proper mutual exclusion techniques must be used to protect
thread unsafe functions.

Additionally, MicroBlaze GCC reports that the thread model is “single.”

If I’m using C++ standard library containers, this is surely unsafe, correct?

I’m having a heck of time even getting an answer to this simple question from Xilinx, let alone a way to fix it. It seems that this is a major deficiency of the Xilinx provided build system.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:39:50+00:00Added an answer on June 17, 2026 at 5:39 pm

    The answer from Xilinx (via email) is below. It makes no mention of multi-threading. It also references a their software tool 8.2i which was released in 2006 (6 years ago!!!). In short, it makes no sense.

    Lessons learned:

    • Xilinx support is terrible.
    • Xilinx software tools are an afterthought for them.
    • I can only assume that what is outlined in documentation is correct, specifically that you cannot use dynamic memory allocation in a multi-threaded environment. This means no c++ standard library containers.
    • If you’re the hardware guy about to select a MicroBlaze soft core processor, check with the firmware guy before you do that. What kind of applications is he expecting to write? Make sure he knows that he can’t write a multi-threaded application in C++.

    malloc()

    Microblaze C library shipped with a small, minimal functionality
    malloc(). When used, memory could not be freed. Other functions such
    as calloc, realloc, etc., were not supported. There were also bugs
    when using both malloc() and routines such as printf, scanf, etc. To
    fix this, the minimal functionality malloc() has been removed. It has
    been replaced by original Newlib malloc(). As a result, you should see
    NO functionality issues. You might see a code size increase of around
    4K. Because of the differences in which the new full functionality
    malloc() requests memory, user programs might need to review their
    heap size settings. If you see your malloc() calls returning NULL,
    where they used to work, try increasing your heap size. This change
    was essential to fix broken functionality.

    For the rare cases where you still want the original light-weight, but
    broken malloc() functionality, the source code (malloc.S) can be
    included as one of the source files to be compiled to build your
    application. This will retain the old functionality, code size
    requirements, and dynamic memory requirements seen prior to EDK 8.2i.

    xil_malloc()

    MicroBlaze C library shipped with an alternative implementation of
    dynamic memory allocation called xil_malloc(). This routine has some
    limitations; it does not allocate memory from the heap, but rather
    from a fixed 64K buffer. This routine has now been deprecated. Though
    this routine is still available for linkage, its use is strongly
    discouraged. Please use malloc(); it is smaller than xil_malloc() and
    provides better functionality. When using malloc(), make sure to
    review your heap size settings to satisfy your dynamic memory
    requirements.

    The standalone BSP contains a parameter “need_xil_malloc”. This
    parameter was intended to allow you to write code that contains
    malloc(), yet wire it to the xil_malloc() implementation. Due to bugs
    in the implementation of the parameter and due to the deprecation of
    xil_malloc(), this parameter is deprecated as well.

    Xilkernel contains a parameter “use_xil_malloc”. This parameter was
    intended to allow the kernel message queue implementations to use
    xil_malloc() instead of malloc(). Due to the deprecation of
    xil_malloc(), this parameter is deprecated as well.

    If you still want xil_malloc() source code for legacy reasons, the
    “xil_malloc.c” and “xil_sbrk.c” files can be downloaded and used.

    C++ Applications

    Prior to EDK 8.2i C++ applications might exhibit unusual behavior,
    memory corruption, etc. To fix these issues, include the attached
    source file (newlib_malloc.c) as part of your application compilation.
    This will fix the unexplained crashes. This work-around fixes bugs in
    the malloc() implementation in the MicroBlaze C library. This
    work-around has been incorporated into the C library starting in EDK
    8.2i.

    This information also appears to be available at: http://www.xilinx.com/support/answers/23345.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has any one ever seen a backspace delimited flat file? My requirement is to
I am going to pick up a task that no one has ever attempted
is it possible to use SQLite for a j2me application ? has anyone ever
I'm wondering if anyone has ever come across a plug-in for mootools that will
I have an existing application with a SQL database that has been coded using
I have made a client and server application. In that when ever i am
I have written a web app that has to save a few files. I
Has anyone ever written their own code to look inside the MXD files created
has anyone ever written a netbeans' toolchain for MS VC++ compiler? Following this bug
Has anyone ever heard of a UNIX shell written in a reasonable language, like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.