All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Blanc <julien.blanc@sprinte.eu>
To: "Xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: [Xenomai] Canonical way to differentiate between NPTL / Cobalt threads
Date: Wed, 28 Mar 2018 16:00:44 +0200	[thread overview]
Message-ID: <1522245644.2732.13.camel@sprinte.eu> (raw)

We're using a mix of regular NPTL posix threads and RT cobalt threads
in our application, using XDDP communication between them.

In a few places, we need to identify the calling context, ie, whether
we're being called from a cobalt RT thread or from a regular NPTL
thread, and act accordingly.

My understanding is that calling pthread_getschedparam and checking
that the returned policy is SCHED_FIFO does the job.

* is it correct ? Or are they some corner cases not covered by this
test ?
* is it the canonical way, or is there another one ? (maybe cheaper -
since this call will do two calls in case of a posix thread, there must
be a cheaper way to detect the running context).

Regards,

Julien




             reply	other threads:[~2018-03-28 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 14:00 Julien Blanc [this message]
2018-03-28 14:16 ` [Xenomai] Canonical way to differentiate between NPTL / Cobalt threads Philippe Gerum
2018-03-28 15:00   ` Julien Blanc

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=1522245644.2732.13.camel@sprinte.eu \
    --to=julien.blanc@sprinte.eu \
    --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.