All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: "Brian L." <bluczkie@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] General question on Native Skin tasks
Date: Wed, 19 Apr 2006 21:45:17 +0200	[thread overview]
Message-ID: <4446934D.4060705@domain.hid> (raw)
In-Reply-To: <6ee4c8380604191042v1e914467k3ce36ffd44843548@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1683 bytes --]

Brian L. wrote:
>> Yes, but when blocking native services are invoked, the caller has to be
>> a native thread again. Only pure non-RT threads with no shared critical
>> paths can be plain pthreads. When in doubt, study the native
>> documentation regarding allowed contexts. The statement "switches to
>> primary mode" indicates that a native thread is required.
> 
> So in this case, can I still call the functions from a thread created
> using pthread_create (assuming that they may momentarily increase in
> priority)?

You can call native (or more general: Xenomai) services from non-RT
threads when they do not let your thread block (or contain the risk of
blocking). To block on some RT resources like a queue or a mutex you
need a RT context, e.g. a native thread.

> 
> Can you explain "no shared critical paths"? Would this include
> contending for a mutex-protected resource which is also used by a
> real-time thread?

Yes, this is such a critical path. You may want that every thread
holding the mutex does this only for a bounded time. To ensure this,
priority inheritance may be applied on the mutex holder, thus it has to
be a rt-thread.

> 
> All of my non-time-critical threads are doing some form of
> communication with real-time threads, either through a queue or
> through mutex-protected memory. Can they still be pthread_create
> threads?

Nope, in this case they have to be extended, i.e. created as native threads.

> 
>> Hope I could clarify the situation.
> 
> You've been supremely helpful. I apologize for asking so many questions.
> 

No problem, I always hope this helps others implicitly as well. :)

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2006-04-19 19:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-16 18:10 [Xenomai-help] General question on Native Skin tasks Brian L.
2006-04-17 13:33 ` Jan Kiszka
2006-04-17 14:50   ` Philippe Gerum
2006-04-17 17:35     ` Philippe Gerum
2006-04-17 20:03       ` Jan Kiszka
2006-04-17 20:44         ` Jan Kiszka
2006-04-18 19:53   ` Brian L.
2006-04-18 21:04     ` Jan Kiszka
2006-04-19 15:27       ` Brian L.
2006-04-19 17:18         ` Jan Kiszka
2006-04-19 17:42           ` Brian L.
2006-04-19 19:45             ` Jan Kiszka [this message]
2006-04-20  3:09               ` Li Yi

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=4446934D.4060705@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=bluczkie@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.