mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH 1/2] let them spin
@ 2015-08-29  8:50 Jens Gustedt
  2015-08-29 17:16 ` Rich Felker
  0 siblings, 1 reply; 7+ messages in thread
From: Jens Gustedt @ 2015-08-29  8:50 UTC (permalink / raw)
  To: musl

Remove a test in __wait that looked if other threads already attempted to
go to sleep in futex_wait.

This has no impact on the fast path. But other than one might think at a
first glance, this slows down if there is congestion.

Applying this patch shows no difference in behavior in a mono-core
setting, so it seems that this shortcut is just superfluous.
---
 src/thread/__wait.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/thread/__wait.c b/src/thread/__wait.c
index dc33c1a..a93d41d 100644
--- a/src/thread/__wait.c
+++ b/src/thread/__wait.c
@@ -4,7 +4,7 @@ void __wait(volatile int *addr, volatile int *waiters, int val, int priv)
 {
 	int spins=100;
 	if (priv) priv = FUTEX_PRIVATE;
-	while (spins-- && (!waiters || !*waiters)) {
+	while (spins--) {
 		if (*addr==val) a_spin();
 		else return;
 	}
-- 
2.1.4



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-08-30 21:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-29  8:50 [PATCH 1/2] let them spin Jens Gustedt
2015-08-29 17:16 ` Rich Felker
2015-08-29 19:38   ` Jens Gustedt
2015-08-30  0:39     ` Rich Felker
2015-08-30  8:41       ` Jens Gustedt
2015-08-30 17:02         ` Rich Felker
2015-08-30 21:48           ` Jens Gustedt

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).