TaiJuWu commented on issue #10981:
URL: https://github.com/apache/nuttx/issues/10981#issuecomment-1772329194

   > > I have some questions about enter_critical_section.
   > > First. When I wrote spinlock code, I found spinlock_irqsave can disable 
interrupt. Why we need to use enter_critical_section in 
[mm_alloc](https://github.com/apache/nuttx/blob/a521fd7b82dec43871b4f56a6ae0d85d124158e9/mm/mm_heap/mm_malloc.c#L50)
 instead of spinlock_irqsave? The operation is very light. And I have read 
[#2213 
(comment)](https://github.com/apache/nuttx/issues/2213#issuecomment-731052528), 
enter_critical_section may make caller sleep and cause delay.
   > 
   > Yes, it should be replaced with spinlock. Actually, we have an issue track 
this: #1144.
   > 
   
   So all functions are not called in IRQ should be replace with 
spinlock_irqsave?
   Are there any other constraints?


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