-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pthread: remove enter_critical_section in pthread_barrier_wait #14626
Conversation
[Experimental Bot, please feedback here] This PR appears to partially meet the NuttX requirements. Here's a breakdown: Strengths:
Weaknesses (requiring further information in the PR):
To fully meet the NuttX requirements, the PR needs to:
By addressing these points, the PR will be much clearer and easier for reviewers to evaluate. |
reason: We decouple semcount from business logic by using an independent counting variable, which allows us to remove critical sections in many cases. Signed-off-by: hujun5 <hujun5@xiaomi.com>
@@ -82,67 +82,35 @@ | |||
|
|||
int pthread_barrier_wait(FAR pthread_barrier_t *barrier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's create a new patch moving pthread_barrierwait.c to libc/pthread, since the new implementation doesn't call the kernel internal api.
Summary
reason:
We decouple semcount from business logic by using an independent counting variable, which allows us to remove critical sections in many cases.
Impact
pthread_barrier_wait
Testing
Build Host:
OS: Ubuntu 20.04
CPU: x86_64
Compiler: GCC 9.4.0
Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic
-machine virt,virtualization=on,gic-version=3
-net none -chardev stdio,id=con,mux=on -serial chardev:con
-mon chardev=con,mode=readline -kernel ./nuttx