Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

microC/OS-II and 'thread safe c library' option

Marking the 'thread safe c library' in ´RTOS Options´ when using microC/OS-II affects the performance.

How does marking ´thread safe c library´ affect my system?

Is there a reason for using it if DO NOT care about portability and OS independability? (as mentioned in the NiosII sw manual)

/S

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    This is the answer I got from Altera:

    Since "thread safe c library" will handle the synchronization of multi tasks to protect the shared resource, the performance will be lower than non thread safe c library.

    If you do not need any operation to protect the shared resource or there isn't any shared resource existed in your application, you do not need to choose thread safe c library option.

    My next question is:

    But if I use the mutexes or semaphores provided by microC/OS-II for protecting shared resources, then why should I use ´thread safe C library´?

    Anyone got a comment?

    /S