All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: "Petr Červenka" <grugh@centrum.cz>, Xenomai <xenomai@xenomai.org>
Subject: Re: rt_task_unblock() POSIX alternative
Date: Tue, 14 Apr 2020 12:43:53 +0200	[thread overview]
Message-ID: <50cc036c-3afd-5afd-8c94-3bdfa9d7aa6c@siemens.com> (raw)
In-Reply-To: <CAFLxGvyoGbnQULdswrikMg-tBetnq-UA5fn_0jqQd1BLgH2U6A@mail.gmail.com>

On 14.04.20 12:41, Richard Weinberger wrote:
> On Tue, Apr 14, 2020 at 12:29 PM Jan Kiszka <jan.kiszka@siemens.com> wrote:
>>> This interrupts the Linux syscall, yes. Does this also work when the
>>> thread blocks on the Xenomai/Cobalt side?
>>>
>>
>> That ::read is a Xenomai syscall, being handled in the end by
>> timerfd_read in the core. So, yes.
> 
> True that, once again I got tricked by wrapping. :-)
> 
>> There were two "tricks" needed: avoid syscall restart (as you already
>> noticed) and using __STD (i.e. __real) pthread_kill in order to get a
>> normal signal out. Oh, and the flag var should better be volatile, but
>> that may still work when lucky.
> 
> While we are here, is there a guarantee that rt_task_unblock() can unblock
> a thread in every situation?
> I have a large Xenomai 2 application on my desk which seems to assumes that.

IIRC, it does so for the native/alchemy API.

> 
> As far as I understand it, unblocking tasks is best effort.
> /me has pthread_mutex_lock() in mind which must not return -EINTR as
> required by POSIX.
> 

Well, when mixing APIs, you can end up in such conflicting goals, indeed.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


  reply	other threads:[~2020-04-14 10:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 13:41 rt_task_unblock() POSIX alternative Petr Červenka
2020-04-07 14:59 ` Jan Kiszka
2020-04-07 15:18   ` Petr Červenka
2020-04-07 15:29     ` Jan Kiszka
2020-04-07 15:30     ` Richard Weinberger
2020-04-08  9:44       ` Petr Červenka
2020-04-08 10:06         ` Richard Weinberger
2020-04-08 21:36         ` Richard Weinberger
2020-04-09 15:00           ` Petr Červenka
2020-04-09 16:13             ` Richard Weinberger
2020-04-09 18:10               ` Petr Červenka
2020-04-09 18:48                 ` Richard Weinberger
2020-04-14  8:16                   ` Petr Červenka
2020-04-14  8:30                     ` Richard Weinberger
2020-04-14  9:10                       ` Petr Červenka
2020-04-14  9:46                         ` Richard Weinberger
2020-04-14 10:07                           ` Jan Kiszka
2020-04-14 10:23                             ` Richard Weinberger
2020-04-14 10:28                               ` Jan Kiszka
2020-04-14 10:41                                 ` Richard Weinberger
2020-04-14 10:43                                   ` Jan Kiszka [this message]
2020-04-14 10:56                                     ` Richard Weinberger
2020-04-14 11:01                                       ` Jan Kiszka
2020-04-14 11:05                                         ` Richard Weinberger
2020-04-14 11:30                                           ` Jan Kiszka
2020-04-14 10:39                             ` Petr Červenka

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=50cc036c-3afd-5afd-8c94-3bdfa9d7aa6c@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=grugh@centrum.cz \
    --cc=richard.weinberger@gmail.com \
    --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.