From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7112 Path: news.gmane.org!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: semaphore redesign Date: Sun, 1 Mar 2015 21:54:13 +0300 (MSK) Message-ID: References: <1409123141.4476.18.camel@eris.loria.fr> <20140827074310.GK12888@brightrain.aerifal.cx> <20150228154247.GQ23507@brightrain.aerifal.cx> 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 1425236076 3289 80.91.229.3 (1 Mar 2015 18:54:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Mar 2015 18:54:36 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7125-gllmg-musl=m.gmane.org@lists.openwall.com Sun Mar 01 19:54:32 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 1YS90Y-0005I7-24 for gllmg-musl@m.gmane.org; Sun, 01 Mar 2015 19:54:30 +0100 Original-Received: (qmail 10104 invoked by uid 550); 1 Mar 2015 18:54:28 -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 10056 invoked from network); 1 Mar 2015 18:54:24 -0000 In-Reply-To: <20150228154247.GQ23507@brightrain.aerifal.cx> User-Agent: Alpine 2.11 (LNX 23 2013-08-11) Xref: news.gmane.org gmane.linux.lib.musl.general:7112 Archived-At: A few more things from IRC discussion. Fields in the semaphore struct should be made volatile. The new implementation eliminates the last call site with non-dummy cleanup argument to __timedwait. New sem_timedwait shows worse performance in Rich's sem-bench on my desktop, I think primarily because it does not have sem_trywait preceding the spin loop anymore, plus the loop itself is also a bit leaner. My proposal is to use a different spin count somewhere in 150-200 range instead of 100. Alexander