Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-27 Thread Robert Treat
On Fri, 2004-01-23 at 00:21, Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Andrew Dunstan wrote: > >> AFAIK the only target build environment for Windows right now is MinGW/gcc > >> > >> If anyone knows how to get the M$ compilers to work nicely with our build > >> system that mi

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-23 Thread Andrew Dunstan
Bruce Momjian wrote: Andrew Dunstan wrote: Tom Lane said: Actually, I was expecting you to complain that the s_lock.h coding is gcc-specific. Which compilers do we need to support on Windows? AFAIK the only target build environment for Windows right now is MinGW/gcc If anyone kn

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-22 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Andrew Dunstan wrote: >> AFAIK the only target build environment for Windows right now is MinGW/gcc >> >> If anyone knows how to get the M$ compilers to work nicely with our build >> system that might be interesting, but probably at a later stage. > MS

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-22 Thread Bruce Momjian
Claudio Natoli wrote: > > > Tom Lane writes: > > [cvs is your friend...] It appears to have been added as part of the > > MinGW porting work last May. I don't have much faith in it; as far as > > I heard the MinGW port never got further than making the client-side > > code work, and so this fil

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-22 Thread Bruce Momjian
Tom Lane wrote: > Claudio Natoli <[EMAIL PROTECTED]> writes: > > Or, maybe we'll just use the tas() implementation that already exists for > > __i386__/__x86_64__ in s_lock.h. How did I miss that? > > Move along. Nothing to see here. > > Actually, I was expecting you to complain that the s_lock.h

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-22 Thread Bruce Momjian
Tom Lane wrote: > Claudio Natoli <[EMAIL PROTECTED]> writes: > > Tom Lane writes: > >> I'm not sure there's any need for > >> src/backend/port/win32/sema.c at all. > > > (Do you have any idea on the historical > > context of this code? I wondered as to, if we have no win32 port, why there > > woul

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-22 Thread Bruce Momjian
Andrew Dunstan wrote: > Tom Lane said: > > > > Actually, I was expecting you to complain that the s_lock.h coding is > > gcc-specific. Which compilers do we need to support on Windows? > > > > AFAIK the only target build environment for Windows right now is MinGW/gcc > > If anyone knows how to g

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-13 Thread Claudio Natoli
> Tom Lane said: > > > > Actually, I was expecting you to complain that the s_lock.h coding is > > gcc-specific. Which compilers do we need to support on Windows? > > > > AFAIK the only target build environment for Windows right now is > MinGW/gcc Yes, I'm working with MingW. > If anyone kno

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-13 Thread Manfred Spraul
Tom Lane wrote: Manfred Spraul <[EMAIL PROTECTED]> writes: What are the chances for Win64 support? sizeof(unsigned long) remains 4, sizeof(void*) is 8. If you can tell me what type Datum should be (unsigned long long maybe?), we could probably handle that. Probably uintptr_t: That's the o

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-13 Thread Tom Lane
Manfred Spraul <[EMAIL PROTECTED]> writes: > What are the chances for Win64 support? sizeof(unsigned long) remains 4, > sizeof(void*) is 8. If you can tell me what type Datum should be (unsigned long long maybe?), we could probably handle that. It was a pretty brain-dead combination of choices o

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-13 Thread Andrew Dunstan
Tom Lane said: > > Actually, I was expecting you to complain that the s_lock.h coding is > gcc-specific. Which compilers do we need to support on Windows? > AFAIK the only target build environment for Windows right now is MinGW/gcc If anyone knows how to get the M$ compilers to work nicely with

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-13 Thread Manfred Spraul
Tom Lane wrote: Claudio Natoli <[EMAIL PROTECTED]> writes: Or, maybe we'll just use the tas() implementation that already exists for __i386__/__x86_64__ in s_lock.h. How did I miss that? Move along. Nothing to see here. Actually, I was expecting you to complain that the s_lock.h coding is

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-13 Thread Tom Lane
Claudio Natoli <[EMAIL PROTECTED]> writes: > Or, maybe we'll just use the tas() implementation that already exists for > __i386__/__x86_64__ in s_lock.h. How did I miss that? > Move along. Nothing to see here. Actually, I was expecting you to complain that the s_lock.h coding is gcc-specific. Whi

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-13 Thread Tom Lane
Claudio Natoli <[EMAIL PROTECTED]> writes: > FWIW, I've done a code walk-through, and it looks ok (lack of real-world > testing notwithstanding), and actually does use the Win32 sema set. The only > real problem is that it calls ShmemInitStruct in semget, which ultimately > gets us into bootstrap h

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-13 Thread Claudio Natoli
> Ok, I think having a native win32 spin-lock implementation > (say, based on InterlockedCompareExchange?) is the minimal > impact answer. I'll work on producing that. Or, maybe we'll just use the tas() implementation that already exists for __i386__/__x86_64__ in s_lock.h. How did I miss that?

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-12 Thread Claudio Natoli
Tom Lane writes: > [cvs is your friend...] It appears to have been added as part of the > MinGW porting work last May. I don't have much faith in it; as far as > I heard the MinGW port never got further than making the client-side > code work, and so this file has no real-world testing. FWIW,

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-12 Thread Tom Lane
Claudio Natoli <[EMAIL PROTECTED]> writes: > Tom Lane writes: >> I'm not sure there's any need for >> src/backend/port/win32/sema.c at all. > (Do you have any idea on the historical > context of this code? I wondered as to, if we have no win32 port, why there > would be a seemingly good-to-go sema

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-12 Thread Claudio Natoli
Tom Lane writes: > > Just working with what we've already got. There seems to be very > > usable code in src/backend/port/win32/sema.c, which gets invoked > > as Win32 does not have spin-locks, but unfortunately relies on > > ShmemInitStruct. > > Win32 certainly has spinlocks; it does not run

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-12 Thread Tom Lane
Claudio Natoli <[EMAIL PROTECTED]> writes: >> The correct solution to that seems to lie elsewhere, ie, not use >> semaphores for spinlocks. > Just working with what we've already got. There seems to be very usable code > in src/backend/port/win32/sema.c, which gets invoked as Win32 does not have >

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-12 Thread Claudio Natoli
> You have broken stuff before by rearranging the sequence of operations... Ah, yeah, well, FWIW, if that is the only thing that gets broken in the process of making this port, I'll be more than satisfied. Will that be held against me forever? > what exactly have you got in mind here? Moving

Re: [HACKERS] LWLock/ShmemIndex startup question

2004-01-12 Thread Tom Lane
Claudio Natoli <[EMAIL PROTECTED]> writes: > Are these comments still true? Specifically, is it necessary to call > CreateLWLocks before InitShmemIndex? I think it used to be, but then the > ShmemIndexLock got made into a separate spinlock in its own right. I think the only dependency was that Shm

[HACKERS] LWLock/ShmemIndex startup question

2004-01-12 Thread Claudio Natoli
In CreateSharedMemoryAndSemaphores, there is the following comment, just before CreateLWLocks(): /* * Now initialize LWLocks, which do shared memory allocation and are * needed for InitShmemIndex. */ Also, in InitShmemAllocation, there is: /* ShmemInde