port to Windows x64

From: Tsutomu Yamada <tsutomu(at)sraoss(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: port to Windows x64
Date: 2009-06-12 12:14:28
Message-ID: 58921.1244808868@srapc2360.sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

We trying to port PostgreSQL to Windows x64.
It based on Windows 64bit patch which are posted before.

http://archives.postgresql.org/pgsql-hackers/2008-07/msg00440.php

Is there someone working in progress about it ?
This patch works if total activity memory is less than 2GB,
but when memory goes over 2GB there is a problem.
(eg) in postgresql.conf, set shared_buffes to over 2GB.

There are still following problems, I thought.

1. LLP64 pointer operation
2. over 4GB shared memory allocation
3. reattch to shared memory

---
1. LLP64
Currently PostgreSQL use 'long' for pointer calculation.
(eg) TYPEALIGN() in src/include/c.h
We intend to replace 'long' to 'intptr_t' in such calculation.

Todo for this.
* check and add typedef 'intptr_t', in configure and port.h
* fix 'long' to 'intptr_t' in pointer calculation.

Microsoft C++ compiler with /Wp64 option will outputs warning about
pointer assignments that losts data.
That helps us to locate source code.

(the past messages)
http://archives.postgresql.org/pgsql-hackers/2008-07/msg00437.php
http://archives.postgresql.org/pgsql-hackers/2008-07/msg00081.php
http://archives.postgresql.org/pgsql-hackers/2008-07/msg00105.php

2. shared memory
Shared buffer allocation function does not care about >=4GB memory.
# PGSharedMemoryCreate() in src/backend/port/win32_shmem.c
We think it can easily to fix.

3. "counld not reattach to shared memory" problem
There is another problem, and that also occurs under Windows 32bit.
http://archives.postgresql.org/pgsql-hackers/2009-05/msg00097.php
http://archives.postgresql.org/pgsql-hackers/2009-05/msg00144.php

Since the last message, I didn't confirm any progress.
We don't have good solution for it.
We thought that following VirtualAllocEx() method was good,
but did somebody try to test ?

http://archives.postgresql.org/pgsql-general/2007-08/msg01592.php

Thanks.

--
Tsutomu Yamada
SRA OSS, Inc. Japan

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2009-06-12 13:02:16 Re: cannot update to the latest CVS sources
Previous Message Merlin Moncure 2009-06-12 12:02:33 Re: Problem with listen_addresses = '*' on 8.4beta2 on AIX