Skip to content

More Description in Example Documentation #36029

Answered by nashif
pearson asked this question in Q&A
Discussion options

You must be logged in to vote
  • Why does it do a k_busy_wait followed by a k_msleep before releasing the semaphore?

this is just to simulate some work done by the thread, a sleep will cause an immediate context switch and the thread total runtime will be very close to zero. There is a comment about this in the code.

  • Why are there three ARG_UNUSED dummy variables at the start of each thread function?

Thread entry functions can have up to 3 variables, you do not have to use them. If you do not use them, compiler might complain, hence the ARG_UNUSED to let the compiler know not to complain.

  • What is the PIN_THREADS define used for, and the k_thread_cpu_mask_clear and k_thread_cpu_mask_enable calls it enables?

On…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@pearson
Comment options

@nashif
Comment options

Answer selected by nashif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #36028 on June 07, 2021 22:16.