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/09 18:01:00 UTC

[GitHub] [incubator-nuttx] raiden00pl commented on issue #6012: Low priority tasks interrupt high priority threads

raiden00pl commented on issue #6012:
URL: https://github.com/apache/incubator-nuttx/issues/6012#issuecomment-1094096841

   I think I know what's going on.
   
   I set breakpoint in `arm_svcall,` which is triggered when pthread is interrupted.
   What I found is that pthread is waiting for semaphore in `fs/inode/fs_files.c` and this switch execution to low priority main.
   
   When I removed `nxsem_wait_uninterruptible` from `_files_semtake` pthread is never interrupted.
   
   It goes more or less like this:
     1. low priority main wakes up just before FOC interrupt
     2. main gets `fs/inode/fs_files.c` semaphore (`fs_getfilep` -> `_files_semtake`)
     3. FOC interrupt occurs and wakes up FOC pthread
     4. pthread tries to get `fs/inodefs_files.c` semaphtore
     5. pthread waits for semaphore
     6. context switch to main
   


-- 
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