TaiJuWu opened a new pull request, #10605:
URL: https://github.com/apache/nuttx/pull/10605

   ## Summary
   Hello. I try to implement fair spinlock and hope I can get some suggestions 
from community
   But I only test on FIFO scheduler and I am not sure my implementation is 
correct or not.
   
   I have two questions:
   Is the call flow of fair_spin_lock too long to effect the performance of 
RTOS?
   My implement didn't consider interrupts so I need to use critical_section?
   
   ## Impact
   None 
   ## Testing
   I try to test by this 
[file.](https://github.com/TaiJuWu/nuttx-apps/blob/fair_spinlock_test/examples/hello/hello_main.c)
   The result like this
   ```
   Thread 6 is exiting lock 4 time.
   Thread 7 is enter lock 4 time.
   Thread 7 is exiting lock 4 time.
   Thread 6 is enter lock 5 time.
   Thread 6 is exiting lock 5 time.
   Thread 7 is enter lock 5 time.
   Thread 7 is exiting lock 5 time.
   Thread 8 is enter lock 1 time.
   Thread 8 is exiting lock 1 time.
   Thread 9 is enter lock 1 time.
   Thread 9 is exiting lock 1 time.
   Thread 8 is enter lock 2 time.
   Thread 8 is exiting lock 2 time.
   Thread 9 is enter lock 2 time.
   Thread 9 is exiting lock 2 time.
   Thread 8 is enter lock 3 time.
   Thread 8 is exiting lock 3 time.
   Thread 9 is enter lock 3 time.
   Thread 9 is exiting lock 3 time.
   Thread 8 is enter lock 4 time.
   Thread 8 is exiting lock 4 time.
   ```
   But I only test on RR scheduler and I am not sure my implementation is 
correct or not.
   And I did't consider preemptive for this version.
   
   If anyone have any suggestions, i would be very grateful.
   


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