All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [Xenomai-git] Jan Kiszka : native: Rework handling of pthread carrier thread
Date: Sun, 06 Jun 2010 14:44:54 +0200	[thread overview]
Message-ID: <4C0B9846.7050203@domain.hid> (raw)
In-Reply-To: <4C0AB7BA.7000100@domain.hid>

Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
>> Jan Kiszka wrote:
>>> Gilles Chanteperdrix wrote:
>>>> Not being able to join a deleted task undermines seriously the utility
>>>> of rt_task_join... What is it useful for, then?
>>> See the doc: You join or delete, but not both.
>> Looks to me like a workaround: you are not able to handle properly the
>> life-cycle of an RT_TASK, so you changed the rules... is there really no
>> other way?
> 
> First of all, it turns a SEGV into a proper error code. Moreover,
> rt_task_join now officially finalizes the object for native (it always
> did technically!), as does pthread_join for POSIX. No rule changed, just
> rule documentation and violation detection added. One may argue about
> join after delete, but for what use case such a change of rt_task_delete
> semantic?

rt_task_delete, pthread_cancel, pthread_detach are not synchronous,
after one of these calls, you do not have any guarantee that the
ressources attached to a thread are free for re-use. After pthread_join,
you do.

So, the question is what is more important, to have a way to wait for
the ressources attached to a thread to be freed? Or to avoid
segmentation faults in broken application?

I do not generally mind segmentation faults in broken applications if we
can not avoid them without breaking other applications. A segmentation
fault is one of the simplest things to debug.

However, I do not have a strong opinion on this, it is just an open
question. More generally, I would like us to discuss once and for all
about the semantic of the various calls and their effect on the RT_TASK
duration, instead of changing this semantic every release and risk
breaking non-broken applications (I mean, the one which do not segfault).

-- 
					    Gilles.


  reply	other threads:[~2010-06-06 12:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1OKZdD-0003ml-45@domain.hid>
2010-06-04 19:48 ` [Xenomai-core] [Xenomai-git] Jan Kiszka : native: Rework handling of pthread carrier thread Gilles Chanteperdrix
2010-06-04 23:58   ` Jan Kiszka
2010-06-05 12:57     ` Gilles Chanteperdrix
2010-06-05 18:43       ` Jan Kiszka
2010-06-05 18:49         ` Gilles Chanteperdrix
2010-06-05 19:14           ` Jan Kiszka
2010-06-05 19:18             ` Gilles Chanteperdrix
2010-06-05 19:22               ` Jan Kiszka
2010-06-05 19:28                 ` Gilles Chanteperdrix
2010-06-05 20:46                   ` Jan Kiszka
2010-06-06 12:44                     ` Gilles Chanteperdrix [this message]
2010-06-18 18:59                       ` Jan Kiszka
2010-06-18 19:06                         ` Gilles Chanteperdrix
2010-06-18 20:17                           ` Jan Kiszka
2010-06-19 10:14                             ` Gilles Chanteperdrix
2010-06-19 11:52                               ` Jan Kiszka
2010-06-19 12:28                                 ` Gilles Chanteperdrix

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=4C0B9846.7050203@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.