From e9dc342e3362ba957abeab9e3bcff89cf4febbb5 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 6 Sep 2001 16:51:12 +0000 Subject: [PATCH] Add mutex test. --- doc/TODO.detail/performance | 62 +++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/doc/TODO.detail/performance b/doc/TODO.detail/performance index 3f4132bedb..3f07fa3c91 100644 --- a/doc/TODO.detail/performance +++ b/doc/TODO.detail/performance @@ -345,7 +345,7 @@ From owner-pgsql-hackers@hub.org Tue Oct 19 10:31:10 1999 Received: from renoir.op.net (root@renoir.op.net [209.152.193.4]) by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id KAA29087 for ; Tue, 19 Oct 1999 10:31:08 -0400 (EDT) -Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.6 $) with ESMTP id KAA27535 for ; Tue, 19 Oct 1999 10:19:47 -0400 (EDT) +Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.7 $) with ESMTP id KAA27535 for ; Tue, 19 Oct 1999 10:19:47 -0400 (EDT) Received: from localhost (majordom@localhost) by hub.org (8.9.3/8.9.3) with SMTP id KAA30328; Tue, 19 Oct 1999 10:12:10 -0400 (EDT) @@ -454,7 +454,7 @@ From owner-pgsql-hackers@hub.org Tue Oct 19 21:25:30 1999 Received: from renoir.op.net (root@renoir.op.net [209.152.193.4]) by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id VAA28130 for ; Tue, 19 Oct 1999 21:25:26 -0400 (EDT) -Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.6 $) with ESMTP id VAA10512 for ; Tue, 19 Oct 1999 21:15:28 -0400 (EDT) +Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.7 $) with ESMTP id VAA10512 for ; Tue, 19 Oct 1999 21:15:28 -0400 (EDT) Received: from localhost (majordom@localhost) by hub.org (8.9.3/8.9.3) with SMTP id VAA50745; Tue, 19 Oct 1999 21:07:23 -0400 (EDT) @@ -1002,3 +1002,61 @@ Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83 +From pgsql-hackers-owner+M11649@postgresql.org Wed Aug 1 15:22:46 2001 +Return-path: +Received: from postgresql.org (webmail.postgresql.org [216.126.85.28]) + by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f71JMjN09768 + for ; Wed, 1 Aug 2001 15:22:45 -0400 (EDT) +Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) + by postgresql.org (8.11.3/8.11.1) with SMTP id f71JMUf62338; + Wed, 1 Aug 2001 15:22:30 -0400 (EDT) + (envelope-from pgsql-hackers-owner+M11649@postgresql.org) +Received: from sectorbase2.sectorbase.com (sectorbase2.sectorbase.com [63.88.121.62] (may be forged)) + by postgresql.org (8.11.3/8.11.1) with SMTP id f71J4df57086 + for ; Wed, 1 Aug 2001 15:04:40 -0400 (EDT) + (envelope-from vmikheev@SECTORBASE.COM) +Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19) + id ; Wed, 1 Aug 2001 12:04:31 -0700 +Message-ID: <3705826352029646A3E91C53F7189E32016705@sectorbase2.sectorbase.com> +From: "Mikheev, Vadim" +To: "'pgsql-hackers@postgresql.org'" +Subject: [HACKERS] Using POSIX mutex-es +Date: Wed, 1 Aug 2001 12:04:24 -0700 +MIME-Version: 1.0 +X-Mailer: Internet Mail Service (5.5.2653.19) +Content-Type: text/plain; + charset="koi8-r" +Precedence: bulk +Sender: pgsql-hackers-owner@postgresql.org +Status: OR + +1. Just changed + TAS(lock) to pthread_mutex_trylock(lock) + S_LOCK(lock) to pthread_mutex_lock(lock) + S_UNLOCK(lock) to pthread_mutex_unlock(lock) +(and S_INIT_LOCK to share mutex-es between processes). + +2. pgbench was initialized with scale 10. + SUN WS 10 (512Mb), Solaris 2.6 (I'm unable to test on E4500 -:() + -B 16384, wal_files 8, wal_buffers 256, + checkpoint_segments 64, checkpoint_timeout 3600 + 50 clients x 100 transactions + (after initialization DB dir was saved and before each test + copyed back and vacuum-ed). + +3. No difference. + Mutex version maybe 0.5-1 % faster (eg: 37.264238 tps vs 37.083339 tps). + +So - no gain, but no performance loss "from using pthread library" +(I've also run tests with 1 client), at least on Solaris. + +And so - looks like we can use POSIX mutex-es and conditional variables +(not semaphores; man pthread_cond_wait) and should implement light lmgr, +probably with priority locking. + +Vadim + +---------------------------(end of broadcast)--------------------------- +TIP 2: you can get off all lists at once with the unregister command + (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) + -- 2.40.0