Using POSIX mutex-es

Using POSIX mutex-es

Post by Bruce Momji » Sat, 08 Sep 2001 03:29:50



Added to TODO.detail/performance.

> 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


--
  Bruce Momjian                        |  http://candle.pha.pa.us

  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command

 
 
 

1. Using POSIX mutex-es

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

2. Report Designer & Columns

3. Using Posix Threads and SYBASE OpenServer threads in same application(executable)

4. plz, Help!! HOW CAN I GET THE ROWNUM IN POSTGRES TABLE AS I DID WITH ORACLE!!

5. POSIX regex performance bug in 7.3 Vs. 7.2

6. NY/CT Oracle web developer

7. support for POSIX 1003.1-2001 hosts

8. ISDN Changes IP Address - lose connection

9. Support for QNX6, POSIX IPC and PTHREAD-style locking

10. POSIX Vs NT, FDDI Vs Ethernet Bus

11. posix style regexp?

12. -1811 error in context of POSIX threaded ESQL/C program