You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/07/30 09:53:26 UTC

[GitHub] [mynewt-core] kasjer opened a new pull request #2651: kernel/os: Fix semaphore release hazard

kasjer opened a new pull request #2651:
URL: https://github.com/apache/mynewt-core/pull/2651


   Context switch is performed in low priority interrupt.
   If higher priority interrupt code releases semaphore
   BEFORE g_current_task is updated in context switch,
   os_sem_release() function can see that task
   that entered os_sem_pend() and initiated context switch
   is still running and there is no need to switch tasks.
   As a result task is marked as ready.
   Then high priority interrupt ends and context switch is
   finished leaving lower priority task running.
   When this happens and current task is idle it may take
   a while till reschedule is done again leaving task that
   should be running in ready state.
   
   To prevent this, condition to reschedule is now changed
   so that if current task is same as task that should be woken
   context switch is also initiated just in case switching
   already started and g_current_task was not updated.


-- 
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@mynewt.apache.org

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



[GitHub] [mynewt-core] kasjer commented on pull request #2651: kernel/os: Fix semaphore release hazard

Posted by GitBox <gi...@apache.org>.
kasjer commented on pull request #2651:
URL: https://github.com/apache/mynewt-core/pull/2651#issuecomment-889779623


   this is alternative solution to #2650 


-- 
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@mynewt.apache.org

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



[GitHub] [mynewt-core] vrahane commented on pull request #2651: kernel/os: Fix semaphore release hazard

Posted by GitBox <gi...@apache.org>.
vrahane commented on pull request #2651:
URL: https://github.com/apache/mynewt-core/pull/2651#issuecomment-891000777


   While both solutions work fine. I prefer this one.


-- 
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@mynewt.apache.org

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



[GitHub] [mynewt-core] andrzej-kaczmarek commented on pull request #2651: kernel/os: Fix semaphore release hazard

Posted by GitBox <gi...@apache.org>.
andrzej-kaczmarek commented on pull request #2651:
URL: https://github.com/apache/mynewt-core/pull/2651#issuecomment-890853502


   I prefer this one since it's simpler, fixes problem for all archs and does not have overhead on context switch.


-- 
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@mynewt.apache.org

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



[GitHub] [mynewt-core] vrahane commented on pull request #2651: kernel/os: Fix semaphore release hazard

Posted by GitBox <gi...@apache.org>.
vrahane commented on pull request #2651:
URL: https://github.com/apache/mynewt-core/pull/2651#issuecomment-890266577


   I did try out this one and seems to be working fine.


-- 
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@mynewt.apache.org

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



[GitHub] [mynewt-core] kasjer merged pull request #2651: kernel/os: Fix semaphore release hazard

Posted by GitBox <gi...@apache.org>.
kasjer merged pull request #2651:
URL: https://github.com/apache/mynewt-core/pull/2651


   


-- 
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@mynewt.apache.org

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