Re: xlog.c: WALInsertLock vs. WALWriteLock - Mailing list pgsql-hackers

From David Fetter
Subject Re: xlog.c: WALInsertLock vs. WALWriteLock
Date
Msg-id 20101023201743.GB20820@fetter.org
Whole thread Raw
In response to xlog.c: WALInsertLock vs. WALWriteLock  (fazool mein <fazoolmein@gmail.com>)
Responses Re: xlog.c: WALInsertLock vs. WALWriteLock
List pgsql-hackers
On Fri, Oct 22, 2010 at 12:08:54PM -0700, fazool mein wrote:
> Hello guys,
> 
> I'm writing a function that will read data from the buffer in xlog
> (i.e.  from XLogCtl->pages and XLogCtl->xlblocks).  I want to make
> sure that I am doing it correctly.

Got an example of what the function might look like?

> For reading from the buffer, do I need to lock WALInsertLock or
> WALWriteLock?  Also, can you explain a bit the usage of 'LW_SHARED'.
> Can we use it for read purposes?

Help me understand.  Do you foresee some kind of concurrency issue,
and if so, what?

Cheers,
David.
> 
> Thanks a lot.

-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


pgsql-hackers by date:

Previous
From: "A.M."
Date:
Subject: create c function with void argument bug?
Next
From: Boxuan Zhai
Date:
Subject: Re: ask for review of MERGE