You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/11 21:28:46 UTC

[GitHub] [incubator-nuttx] patacongo commented on issue #6037: thread and task behavior should be consistent?

patacongo commented on issue #6037:
URL: https://github.com/apache/incubator-nuttx/issues/6037#issuecomment-1095584488

   This might be correct behavior for NuttX.  In NuttX, the scheduler and priority are determined by the parent task.  So the pthread inherits SCHED_FIFO (probably) and same priority as the parent task.  Since the parent never gave the child an opportunity to run, the output from the pthread never occurred.
   
   Linux works differently.  The scheduler will default to SCHED_OTHER and priority 5 (I think).  That will be inherited by the pthread (unless PTHREAD_EXPLICIT is used).  SCHED_OTHER is a fair scheduler, SCHED_FIFO is not and from my understanding of the FIFO scheduler, the behavior you show is correct.
   
   What you are suggesting is that pthread_create() should yield.  I don't think would be correct.
   
   In order to do a correct comparison with Linux, you would need to set SCHED_FIFO and an appropriate priority.  I would be interested in the result.  I don't know what would happen!!!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org