Skip site navigation (1) Skip section navigation (2)

Re: Shared memory and memory context question

From: richard(at)playford(dot)net
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Shared memory and memory context question
Date: 2006-02-05 14:58:46
Message-ID: 200602051458.46978.richard@playford.net (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sun February 5 2006 14:43, Martijn van Oosterhout wrote:
> So what you load are the already processed rules? In that case you
> could probably use the buffer management system. Ask it to load the
> blocks and they'll be in the buffer cache. As long as you have the
> buffer pinned they'll stay there. That's pretty much a read-only
> approach.
>
> If you're talking about things that don't come from disk, well, hmm...
> If you want you could use a file on disk as backing and mmap() it into
> each processes address space...
	<...>
> The real question is, does it need to be shared-writable.
> Shared-readonly is much easier (ie one writer, multiple readers). Using
> a file as backing store for mmap() may be the easiest....

I load the rules from a script and parse them, storing them in a forest of 
linked malloced structures. These structures are created by one writer but 
then read by a number of readers, and later may be removed by the original 
writer.

So, as you can imagine, I could store the forest in the db, although it might 
be a mess. First I will look through the buffer management system, and see if 
that will do the job.

Thanks for your help,

Regards,

Richard


In response to

pgsql-hackers by date

Next:From: Stephen FrostDate: 2006-02-05 15:51:56
Subject: Re: [HACKERS] Postgres 8.1.x and MIT Kerberos 5
Previous:From: Andrew DunstanDate: 2006-02-05 14:44:09
Subject: drop if exists remainder

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group