Re: experimental: replace s_lock spinlock code with pthread_mutex on linux - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: experimental: replace s_lock spinlock code with pthread_mutex on linux
Date
Msg-id 20120627065943.GA25028@svana.org
Whole thread Raw
In response to experimental: replace s_lock spinlock code with pthread_mutex on linux  (Nils Goroll <slink@schokola.de>)
Responses Re: experimental: replace s_lock spinlock code with pthread_mutex on linux  (Nils Goroll <slink@schokola.de>)
List pgsql-hackers
On Wed, Jun 27, 2012 at 12:58:47AM +0200, Nils Goroll wrote:
> So it looks like using pthread_mutexes could at least be an option on Linux.
>
> Using futexes directly could be even cheaper.

Note that below this you only have the futex(2) system call. Futexes
require all counter manipulation to happen in userspace, just like now,
so all the per architecture stuff remains.  On Linux pthread mutexes
are really just a thin wrapper on top of this.

The futex(2) system call merely provides an interface for handling the
blocking and waking of other processes and releasing locks on process
exit (so everything can still work after a kill -9).

So it's more a replacement for the SysV semaphores than anything else.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.  -- Arthur Schopenhauer

pgsql-hackers by date:

Previous
From: Rushabh Lathia
Date:
Subject: Server crash while trying to fetch EXPLAIN query results with a cursor
Next
From: Joel Jacobson
Date:
Subject: Re: Schema version management