Using POSIX mutex-es

Поиск
Список
Период
Сортировка
От Mikheev, Vadim
Тема Using POSIX mutex-es
Дата
Msg-id 3705826352029646A3E91C53F7189E32016705@sectorbase2.sectorbase.com
обсуждение исходный текст
Ответы Re: Using POSIX mutex-es  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
1. Just changedTAS(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_files8, wal_buffers 256,  checkpoint_segments 64, checkpoint_timeout 3600  50 clients x 100 transactions  (after
initializationDB 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dave Blasby
Дата:
Сообщение: How to find the database name during run-time
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Problem with FK referential actions