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 2021/07/02 02:53:30 UTC

[GitHub] [incubator-nuttx] Donny9 commented on pull request #4035: work_queue: schedule the work queue using the timer mechanism

Donny9 commented on pull request #4035:
URL: https://github.com/apache/incubator-nuttx/pull/4035#issuecomment-872674331


   @hartmannathan @davids5 Hello, I did have some problems using the previous Work Queue, Then, I done this PR with reference to the delay work implementation of Linux. 
   
   PR1:  Unifies the kwork_lpwork.c and kwork_hpwork.c to kwork_thread.c, because LP and HP worker thread are same, just the handle of wqueue is different and we can fix the difference by pass parameter to worker thread when they were created.
   
   PR2: Using wd timer to keep work queue with delay are ordered and can remove the complicated timing update logic. 
   The PR can fix flollowing issue:
   1. It can reduce the number of awakenings of worker thread. For Previous work queue, If one work with delay is queued and multiple workers thread wait at the same time have just been awakened,  Then each of them will update the work, this is wrong. If using wd timer, it will start a timer and post a semaphore when timer expired, then only one of worker thread will wake up.
   2. In this PR, we need to ensure that the POST and WAIT operations are equal. 
       Post occurs when the work queue.
       Wait occurs when worker thread waiting and work cancel. but if we cancel work in interrupt handlers, wait can't run so that worker thread will be awakened and work is empty, The PR has covered this case.
   


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