This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [parisc-linux] Re: NPTL for hppa-linux is not backwards compatible with Linuxthreads.


On 2/23/07, Roland McGrath <roland@redhat.com> wrote:
> Unfortunatly, due to alignment the NPTL pthread_cond_t grows larger
> than the Linuxthreads version when I add the padding. This is the only
> structure the grows larger in size than before. Is there any way I can
> avoid adding the padding?

It looks to me like you have one word to spare.  That's all you really
need.  That word will only ever be 1 from old PTHREAD_COND_INITIALIZER.
Checking all three padding words is really just paranoia trying to
distinguish clobbered structs from old initialized data.

I did a couple of tests and I verified that I have no words to spare. Adding an extra "int __pad" forces the structure to grow by 8 bytes due to the "long long" alignment requirements.

Would I be allowed to allocated a temporary pthread_cond_t in the
wrapper, store the address in one of the 3 unused lock words, and have
all the wrapper functions use that after allocation?

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]