From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8399 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 2/2] make the number of spins tuneable Date: Sat, 29 Aug 2015 13:17:30 -0400 Message-ID: <20150829171730.GE7833@brightrain.aerifal.cx> References: <1440838216.693.5.camel@dysnomia.u-strasbg.fr> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1440868664 30592 80.91.229.3 (29 Aug 2015 17:17:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Aug 2015 17:17:44 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8411-gllmg-musl=m.gmane.org@lists.openwall.com Sat Aug 29 19:17:44 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZVjlA-0007d5-3N for gllmg-musl@m.gmane.org; Sat, 29 Aug 2015 19:17:44 +0200 Original-Received: (qmail 15752 invoked by uid 550); 29 Aug 2015 17:17:42 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 15734 invoked from network); 29 Aug 2015 17:17:42 -0000 Content-Disposition: inline In-Reply-To: <1440838216.693.5.camel@dysnomia.u-strasbg.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8399 Archived-At: On Sat, Aug 29, 2015 at 10:51:15AM +0200, Jens Gustedt wrote: > --- > src/thread/__wait.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/src/thread/__wait.c b/src/thread/__wait.c > index a93d41d..46501cb 100644 > --- a/src/thread/__wait.c > +++ b/src/thread/__wait.c > @@ -1,8 +1,14 @@ > #include "pthread_impl.h" > > +#ifndef __WAIT_SPINS > +# define __WAIT_SPINS 100 > +#endif > + > +int __wait_spins = __WAIT_SPINS; > + > void __wait(volatile int *addr, volatile int *waiters, int val, int priv) > { > - int spins=100; > + int spins=__wait_spins; > if (priv) priv = FUTEX_PRIVATE; > while (spins--) { > if (*addr==val) a_spin(); > -- > 2.1.4 I don't understand the intended usage. This is not suitable as a public API. Rich