wyr-7 opened a new pull request, #3397:
URL: https://github.com/apache/nuttx-apps/pull/3397
…mization
VELAPLATFO-51602
Add a comprehensive test suite to validate the reader-writer semaphore
optimization that reduces unnecessary context switches. The optimization
ensures up_wait() is only called when the lock is actually released
(writer/reader count reaches 0), avoiding premature wake-ups.
Test Coverage:
- Core Correctness Tests (6 tests):
* Multiple readers with no writers (concurrent read access)
* Multiple writers exclusive access verification
* Mixed reader-writer access patterns
* Waiter wake-up correctness
* Lock holder tracking (recursive write lock support)
* Context switch reduction verification
- Performance Tests (3 tests):
* Recursive write lock performance
* Converted lock (read->write) performance
* High contention multi-threaded performance (8 threads)
- Basic Functionality Tests (1 test):
* Basic read/write/recursive lock operations
Key APIs Tested:
- init_rwsem() / destroy_rwsem()
- down_read() / up_read()
- down_write() / up_write()
- Recursive locking behavior
- Lock holder field tracking
This test suite validates commit Id3b49dda0309b098f04e8ab499c28c94fe1f77ce
which optimizes rwsem to reduce context switches in NuttX.
Change-Id: Icabbc9a65e879d6689529d0c8e3aecbdbd9bd6be
*Note: Please adhere to [Contributing
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
## Summary
*Update this section with information on why change is necessary,
what it exactly does and how, if new feature shows up, provide
references (dependencies, similar problems and solutions), etc.*
## Impact
*Update this section, where applicable, on how change affects users,
build process, hardware, documentation, security, compatibility, etc.*
## Testing
*Update this section with details on how did you verify the change,
what Host was used for build (OS, CPU, compiler, ..), what Target was
used for verification (arch, board:config, ..), etc. Providing build
and runtime logs from before and after change is highly appreciated.*
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]