GooTal commented on issue #2935:
URL: https://github.com/apache/nuttx/issues/2935#issuecomment-1751949713

   Oh, i got a question about this, too.
   
   If a sporadic thread is blocked during its high-priority budget, then wake 
up during its low-priority, the sporadic thread will just execute at 
low-priority.  But the budget is never consumed during one replenishment 
interval.
   
   But i think we should let the sporadic continues to consume its high 
priority, if its budget is not really consumed and replenishment time is not 
yet arrived.
   
   I think the problem might be the watchdog. `sporadic_budget_start` called 
watchdog and `sporadic_budget_expire` then set to low-priority. Then 
`sporadic_interval_start` is called and `sporadic_interval_expire` is called. 
This means that once the thread is blocked during high-priority, the high 
priority budget watchdog still consumes the budget. 
   
   I come up with an idea that might be useful: Let\`s just set the 
replenishment watch dog. When the replenishment time comes, thread\`s budget is 
replenished no matter how much it is left. Once the sporadic is running, let 
the tcb->timeslice indicates the budget. For example, replenishment = 5, budget 
= 2. tcb->timeslice is set to 2 initially. If the 2 budget is consumed, set 
tcb->timeslice to 0. In this case, if the thread is blocked during 
high-priority, it still could be rescheduled at a high priority, untill its 
budget consumed. This would need some modification to the scheduler.
   
   @patacongo 


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

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

Reply via email to