All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: roland Tollenaar <rolandtollenaar@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] warnings and tangled threads.
Date: Wed, 28 Feb 2007 08:55:39 +0100	[thread overview]
Message-ID: <45E5357B.4090107@domain.hid> (raw)
In-Reply-To: <bc4264770702271525q6d5d164lfa34b421a64eeb70@domain.hid>

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

roland Tollenaar wrote:
> Hi,
> 
> Ok I have CAN functionality of some form running in my tasks.
> Initializing seems to be successful and I have written some kind of
> wrapper to create a can_write() function of my own which also seems to
> be -kind of-  working. I have one question and one problem.
> 
> I keep on getting this compile warning
> 
> In file included from /mnt/appusb/xenomai/include/rtdm/rtcan.h:250,
>                 from cancom.cpp:15:
> /mnt/appusb/xenomai/include/rtdm/rtdm.h: In function `ssize_t
> rt_dev_sendto(int, const void*, size_t, int, const sockaddr*,
> socklen_t)':
> /mnt/appusb/xenomai/include/rtdm/rtdm.h:323: warning: missing
> initializer for member `msghdr::msg_flags'
> 
> Its in rtdm.h so I have not looked closely at it yet but I presume I
> must be doing something wrong to be getting it?

That seems to be due to non-default -Wmissing-field-initializers, right?
Will have a look if we can quiet gcc.

> 
> The problem I have is that I test my code by running rtcanrecv on
> rtcan0 while my application also sends on rtcan0.
> 
> What happens is that one of the two real-time tasks does not start up.
> If I am lucky the one (task1) calling can_write() starts up and then
> the messages come through to rtcanrecv. Great. But if I am less lucky
> then task 2 runs happily and task1  does nothing. Nothing is received
> on rtcanrecv.
> 
> If rtcanrecv is not running then my application has no problems. I can
> see that it is writing by reading out /proc/rtcan/rtcan0/info looking
> at TxCount.
> 
> I call can_write() directly after rt_task_wait_period so i did not
> think it necessary to use rt_task_shadow or such like in it.

rt_task_shadow() is required if you call blocking services like
rt_task_wait_period from a task AND you didn't create it via some other
native service (rt_task_spawn or rt_task_create/start).

> Can_write is implemented in a separate .cpp file to the one in which
> it is called. Can this cause memory faults? Must I use mlockall in
> can_write() or something?

mlockall is needed once for a _process_, not per thread (or rt_task).

If the problem persists even with clean rt_task setup (rt_task_shadow
etc.), I guess it's best you post your code.

Jan


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

  reply	other threads:[~2007-02-28  7:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27 23:25 [Xenomai-help] warnings and tangled threads roland Tollenaar
2007-02-28  7:55 ` Jan Kiszka [this message]
2007-02-28  8:40   ` Jan Kiszka
2007-02-28 13:53     ` Jan Kiszka
2007-03-01 19:51       ` roland Tollenaar
2007-03-01 20:27         ` Jan Kiszka
2007-03-01 20:27         ` Dmitry Adamushko
2007-02-28 18:00   ` roland Tollenaar
2007-02-28 20:10     ` Wolfgang Grandegger

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=45E5357B.4090107@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=rolandtollenaar@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.