public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: "Maciej W. Rozycki" <macro@mips.com>
Cc: Djordje Todorovic <djordje.todorovic@rt-rk.com>,
	       Pedro Alves <palves@redhat.com>,
	binutils@sourceware.org,        gdb-patches@sourceware.org,
	asowda@cisco.com,        petar.jovanovic@rt-rk.com,
	nemanja.popov@rt-rk.com,        nikola.prica@rt-rk.com
Subject: Re: [PATCH 3/3] Add test for fetching TLS from core file
Date: Thu, 19 Oct 2017 20:14:00 -0000	[thread overview]
Message-ID: <cfd1fbbf3af8ec0430da8b91a1a68e98@polymtl.ca> (raw)

On 2017-10-18 09:35, Maciej W. Rozycki wrote:
>> +int
>> +main (void)
>> +{
>> +  pthread_t threads[NUMBER_OF_THREADS];
>> +  int i;
>> +  for (i = 0; i < NUMBER_OF_THREADS; i++)
>> +    pthread_create (&threads[i], NULL, thread, &i);
> 
>  Missing `return' statement here.
> 
>  Also `while (1) sleep (10);' perhaps, so that you don't cause a race 
> with
> the whole process terminating (I think `pthread_join (&threads[0], 
> NULL);'
> would do too; I'm sure there are other ways as well to prevent from
> running to exit(2)).  Overall please don't assume any particular thread
> scheduling characteristics of the underlying OS, and especially on SMP
> systems effects may be sometimes surprising.

Just make sure to avoid an infinite loop, in case the inferior is 
somehow left running after executing the test because of some bug 
somewhere.

Simon

             reply	other threads:[~2017-10-19 20:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 20:14 Simon Marchi [this message]
2017-10-23 23:43 ` Maciej W. Rozycki
2017-10-24  2:05   ` Simon Marchi
  -- strict thread matches above, loose matches on Subject: below --
2017-10-25 14:15 [PATCH 1/3] BFD: Write Linux core PRSTATUS note into MIPS " Djordje Todorovic
2017-10-25 14:15 ` [PATCH 3/3] Add test for fetching TLS from " Djordje Todorovic
2017-10-17 13:50 [PATCH 1/3] BFD: Write Linux core PRSTATUS note into MIPS " Djordje Todorovic
2017-10-17 13:50 ` [PATCH 3/3] Add test for fetching TLS from " Djordje Todorovic
2017-10-18 13:37   ` Maciej W. Rozycki
2017-10-24 11:17     ` Pedro Alves

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=cfd1fbbf3af8ec0430da8b91a1a68e98@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=asowda@cisco.com \
    --cc=binutils@sourceware.org \
    --cc=djordje.todorovic@rt-rk.com \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@mips.com \
    --cc=nemanja.popov@rt-rk.com \
    --cc=nikola.prica@rt-rk.com \
    --cc=palves@redhat.com \
    --cc=petar.jovanovic@rt-rk.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).