Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kai Tietz <ktietz70@googlemail.com>
To: John Spencer <maillist-gdbpatches@barfooze.de>
Cc: gdb-patches@sourceware.org
Subject: Re: wrong assumptions about pthread_t being numeric
Date: Thu, 29 Sep 2011 08:39:00 -0000	[thread overview]
Message-ID: <CAEwic4YUN78ATPxSz8tC1_xq4aeV-XbQ_ufGGW9GEWn4k3cTzw@mail.gmail.com> (raw)
In-Reply-To: <4E83D50B.60002@barfooze.de>

2011/9/29 John Spencer <maillist-gdbpatches@barfooze.de>:
> On 09/17/2011 05:43 PM, John Spencer wrote:
>>
>> On 09/17/2011 04:28 AM, Joel Brobecker wrote:
>>>>
>>>> i disagree. adding a proper solution once is superior to creating
>>>> dozens of special case hacks.  also it saves a lot of time in the long
>>>> term.
>>>
>>> Based on my experience so far, I have to agree with Pedro.
>>> But if you do have a superior solution, we'll take a look.
>>> I still have to tell you that I won't like it if your solution
>>> makes the code harder to read. Sometimes, that's OK because it
>>> helps achieving portability.  But when there is no such need for
>>> portability, it just gets in the way. Let's also be pragmatic,
>>> here and fix the problems that we know we have.
>>>
>> it would be nice to have an approach which would just work anywhere and
>> respect the spec,
>> however i currently have not the resources to implement it.
>>
>> thus, as you suggested, i came up with a small patch fixing the issue at
>> hand. the solution should work on any sys/libc combination where
>> sizeof(long) == sizeof(void*) and pthread_t is either a pointer or an int
>> with sizeof equal or less than sizeof long.
>> this should cover all currently existing combinations.
>>
>> i may find more spots in the future which need the application of the
>> macro, and will eventually be sending more patches applying the conversion
>> macro to it.
>>
>> -- JS
>>
>>
>
> knock, knock. anybody here ?
> please tell me wether you accept my patch or not.
>
> -- JS

Well, I can't approve this and I won't.  But I would like to give me 5
cents for this approach.  This approach seems to me bogus, as you are
dependent to sizeof (long) == sizeof (void *), which is a broken
attempt.  It might be a way to use here instead intptr_t instead of
long type.  Nevertheless I admit that the pthread standard doesn't
disallow structure-typed pthread_t, so it might be still worth to
support this for gthread posix.

For windows there is a pthread implementation "winpthread" - hosted by
mingw-w64 project in experimental tree but it will be soon put into
active trunk. This one uses here for pthread_t an integer-scalar
handle instead of a structure, so issues about current implementation
in gthread are working fine.

Regards,
Kai


  reply	other threads:[~2011-09-29  8:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-16 23:01 John Spencer
2011-09-16 23:16 ` Pedro Alves
2011-09-17  0:31   ` John Spencer
2011-09-17  1:05     ` Pedro Alves
2011-09-17  1:23       ` John Spencer
2011-09-17  2:29         ` Matt Rice
2011-09-17  6:47         ` Joel Brobecker
2011-09-18  0:11           ` John Spencer
2011-09-29  2:31             ` John Spencer
2011-09-29  8:39               ` Kai Tietz [this message]
2011-10-01  1:08                 ` John Spencer
2011-09-29 11:10               ` Pedro Alves
2011-09-17 15:29         ` Pedro Alves
2011-09-17 15:47           ` Pedro Alves
2011-10-01  1:02             ` John Spencer
2011-10-01  2:00               ` Pedro Alves
2011-10-01  9:00                 ` Mark Kettenis
2011-10-01  9:14                   ` Kevin Pouget
2011-10-05  8:02                 ` John Spencer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEwic4YUN78ATPxSz8tC1_xq4aeV-XbQ_ufGGW9GEWn4k3cTzw@mail.gmail.com \
    --to=ktietz70@googlemail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=maillist-gdbpatches@barfooze.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox