Re: Portability issues in shm_mq - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Portability issues in shm_mq
Date
Msg-id 10057.1395024306@sss.pgh.pa.us
Whole thread Raw
In response to Re: Portability issues in shm_mq  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Portability issues in shm_mq  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> But I think there's another possible problem here.  In order for reads
> from the buffer not to suffer alignment problems, the chunk size for
> reads and writes from the buffer needs to be MAXIMUM_ALIGNOF (or some
> multiple of it).  And in order to avoid a great deal of additional and
> unwarranted complexity, the size of the message word also needs to be
> MAXIMUM_ALIGNOF (or some multiple of it).  So the message word can
> only be of size 4 if MAXIMUM_ALIGNOF is also 4.  IOW, I think your
> approach is going to run into trouble on any system where
> sizeof(Size)==4 but MAXIMUM_ALIGNOF==8.

Well, it will result in padding space when you maxalign the length word,
but I don't see why it wouldn't work; and it would certainly be no less
efficient than what's there today.

I'll be quite happy to test the results on my old HPPA box, which has
exactly those properties, if you're worried about it.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [BUGS] BUG #9223: plperlu result memory leak
Next
From: Tom Lane
Date:
Subject: Re: Minimum supported version of Python?