All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Matthias Schneider <ma30002000@yahoo.de>,
	"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] race condition when creating and deleting VxWorks tasks in xenomai-forge
Date: Thu, 06 Feb 2014 10:51:43 +0100	[thread overview]
Message-ID: <52F35B2F.7000303@xenomai.org> (raw)
In-Reply-To: <1391541132.31887.YahooMailNeo@web171604.mail.ir2.yahoo.com>

On 02/04/2014 08:12 PM, Matthias Schneider wrote:
> the patch seems to address the original problem. Should this patch be merged
> into the repository?
>

It is on its way to 'master', currently pending in 'next'.

> However, I seem to stumble into a different problem. If I understand correctly,
> CANCEL_DEFER() should prevent the thread/task from being cancelled.

...asynchronously. This is the important missing part.

I have verified
> that pthread_setcanceltype() is being entered and the CONFIG_XENO_ASYNC_CANCEL
> macro has thus been set correctly. Nevertheless, putting a printf after CANCEL_DEFER
> and before CANCEL_RESTORE shows that when rapidly creating and destroying tasks
> the CANCEL_RESTORE printf is not printed. Also, I run into a deadlock very quickly,
> due to wind_task_lock being held (consistent with the observed printf behavior).
> I am using Mercury on top on an unpatched linux kernel. Any idea how I can debug the
> apparently non-functioning pthread_setcanceltype ?
>

Per POSIX, printf() is a cancellation point, any pending cancellation 
request will be handled unconditionally when traversing it. CANCEL_DEFER 
will only postpone async cancellation requests, until a cancellation 
point is traversed or async cancellation mode is enabled back, whichever 
comes first.

http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html

-- 
Philippe.


      reply	other threads:[~2014-02-06  9:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-02 20:37 [Xenomai] race condition when creating and deleting VxWorks tasks in xenomai-forge Matthias Schneider
2014-02-03 11:03 ` Philippe Gerum
2014-02-04 19:12   ` Matthias Schneider
2014-02-06  9:51     ` Philippe Gerum [this message]

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=52F35B2F.7000303@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=ma30002000@yahoo.de \
    --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.