Radek,
On 06/20/2011 03:27 PM, Radosław Smogura wrote:
> When playing with mmap I done some approach how to deal with growing
> files, so...
Your approach seems to require a SysV alloc (for nattach) as well as
POSIX shmem and/or mmap. Adding requirements for these syscalls
certainly needs to give a good benefit for Postgres, as they presumably
pose portability issues.
> 3. a. Lock header when adding chunks (1st chunk is header) (we don't
> want concurrent chunk allocation)
Sure we don't? There are at least a dozen memory allocators for
multi-threaded applications, all trying to optimize for concurrency.
The programmer of a multi-threaded application doesn't need to care much
about concurrent allocations. He can allocate (and free) quite a lot of
tiny chunks concurrently from shared memory.
Regards
Markus Wanner