* [Xenomai-help] Problems with Threads and RTnet
@ 2008-06-25 15:49 Karl Reichert
2008-06-25 15:56 ` Gilles Chanteperdrix
2008-06-26 4:01 ` [Xenomai-help] how to make my own application in Xenomai indra sakti
0 siblings, 2 replies; 10+ messages in thread
From: Karl Reichert @ 2008-06-25 15:49 UTC (permalink / raw)
To: xenomai; +Cc: RTnet-users
Hello list,
I have some problems with RTnet and threads. I create two thread via rt_task_spawn(), one is sending and one is receiving (non-blocking) frames over rtnet.
Each task is existed with return (I also tried rt_task_delete()) and the main-function is waiting for task-termination via rt_task_join().
When I run this program the first time, everything is fine. When I run it a second time without rebooting, I can't receive any more frames (returnvalue -1).
So it seems that the termination of the tasks and the main-function from the first run failed to free the "RTnet resources", too.
Any idea, what I'am doing wrong?
Thanks in advance
(... and good luck to the german team, for all the soccer fans out there)
Karl
--
von Karl Reichert
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-help] Problems with Threads and RTnet
2008-06-25 15:49 [Xenomai-help] Problems with Threads and RTnet Karl Reichert
@ 2008-06-25 15:56 ` Gilles Chanteperdrix
2008-06-26 4:01 ` [Xenomai-help] how to make my own application in Xenomai indra sakti
1 sibling, 0 replies; 10+ messages in thread
From: Gilles Chanteperdrix @ 2008-06-25 15:56 UTC (permalink / raw)
To: Karl Reichert; +Cc: xenomai
Karl Reichert wrote:
> Hello list,
>
> I have some problems with RTnet and threads. I create two thread via rt_task_spawn(), one is sending and one is receiving (non-blocking) frames over rtnet.
>
> Each task is existed with return (I also tried rt_task_delete()) and the main-function is waiting for task-termination via rt_task_join().
>
> When I run this program the first time, everything is fine. When I run it a second time without rebooting, I can't receive any more frames (returnvalue -1).
>
> So it seems that the termination of the tasks and the main-function from the first run failed to free the "RTnet resources", too.
>
> Any idea, what I'am doing wrong?
What version of Xenomai are you running ? Do not you get error messages
in the console ?
--
Gilles.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Xenomai-help] how to make my own application in Xenomai
2008-06-25 15:49 [Xenomai-help] Problems with Threads and RTnet Karl Reichert
2008-06-25 15:56 ` Gilles Chanteperdrix
@ 2008-06-26 4:01 ` indra sakti
2008-06-26 6:41 ` Gilles Chanteperdrix
1 sibling, 1 reply; 10+ messages in thread
From: indra sakti @ 2008-06-26 4:01 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 360 bytes --]
Hello..
I'm a newbie using xenomai domain, and i still don't understand how to write an application in user-space so that xenomai domain recognize it. Do we should use xenomai library and makefile like in the example folder? Can someone explain me?
Sorry, i'm not really experienced in linux kernel and anything about it..
Thanx..
--Indra--
[-- Attachment #2: Type: text/html, Size: 518 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-help] how to make my own application in Xenomai
2008-06-26 4:01 ` [Xenomai-help] how to make my own application in Xenomai indra sakti
@ 2008-06-26 6:41 ` Gilles Chanteperdrix
0 siblings, 0 replies; 10+ messages in thread
From: Gilles Chanteperdrix @ 2008-06-26 6:41 UTC (permalink / raw)
To: sakti7387; +Cc: xenomai
indra sakti wrote:
> Hello..
>
> I'm a newbie using xenomai domain, and i still don't understand how
> to write an application in user-space so that xenomai domain
> recognize it. Do we should use xenomai library and makefile like in
> the example folder? Can someone explain me?
For examples using the native API, please read:
http://www.xenomai.org/documentation/branches/v2.3.x/pdf/Native-API-Tour-rev-C.pdf
For the posix skin, see doc/txt/pse51-skin.txt.
> Sorry, i'm not really experienced in linux kernel and anything about
> it..
You should spend your time reading documentations before your start
asking questions on mailing lists, then.
--
Gilles.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-help] Problems with Threads and RTnet
@ 2008-06-26 10:03 Karl Reichert
2008-06-30 8:40 ` Karl Reichert
0 siblings, 1 reply; 10+ messages in thread
From: Karl Reichert @ 2008-06-26 10:03 UTC (permalink / raw)
To: rtnet-users; +Cc: xenomai
> Karl Reichert wrote:
> > Hello list,
> >
> > I have some problems with RTnet and threads. I create two thread via
> rt_task_spawn(), one is sending and one is receiving (non-blocking) frames
> over rtnet.
> >
> > Each task is existed with return (I also tried rt_task_delete()) and the
> main-function is waiting for task-termination via rt_task_join().
> >
> > When I run this program the first time, everything is fine. When I run
> it a second time without rebooting, I can't receive any more frames
> (returnvalue -1).
> >
> > So it seems that the termination of the tasks and the main-function from
> the first run failed to free the "RTnet resources", too.
> >
> > Any idea, what I'am doing wrong?
>
> What version of Xenomai are you running ? Do not you get error messages
> in the console ?
>
> --
> Gilles.
I'm running Xenomai 2.4.3 with Rtnet 0.9.10
And sorry for the mistake, rt_dev_recv() returns with -110 which means "connection timeout". There might be some problems with the socket, but I don't have a clue, what's going on.
I do not get any error messages in console. Neither dmesg nor /var/log/sys reports an error.
Best regards,
Karl
--
von Karl Reichert
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-help] Problems with Threads and RTnet
2008-06-26 10:03 [Xenomai-help] Problems with Threads and RTnet Karl Reichert
@ 2008-06-30 8:40 ` Karl Reichert
2008-06-30 13:49 ` Gilles Chanteperdrix
0 siblings, 1 reply; 10+ messages in thread
From: Karl Reichert @ 2008-06-30 8:40 UTC (permalink / raw)
To: Karl Reichert, rtnet-users; +Cc: xenomai
> > Karl Reichert wrote:
> > > Hello list,
> > >
> > > I have some problems with RTnet and threads. I create two thread via
> > rt_task_spawn(), one is sending and one is receiving (non-blocking)
> frames
> > over rtnet.
> > >
> > > Each task is existed with return (I also tried rt_task_delete()) and
> the
> > main-function is waiting for task-termination via rt_task_join().
> > >
> > > When I run this program the first time, everything is fine. When I run
> > it a second time without rebooting, I can't receive any more frames
> > (returnvalue -1).
> > >
> > > So it seems that the termination of the tasks and the main-function
> from
> > the first run failed to free the "RTnet resources", too.
> > >
> > > Any idea, what I'am doing wrong?
> >
> > What version of Xenomai are you running ? Do not you get error messages
> > in the console ?
> >
> > --
> > Gilles.
>
> I'm running Xenomai 2.4.3 with Rtnet 0.9.10
>
> And sorry for the mistake, rt_dev_recv() returns with -110 which means
> "connection timeout". There might be some problems with the socket, but I
> don't have a clue, what's going on.
>
> I do not get any error messages in console. Neither dmesg nor /var/log/sys
> reports an error.
>
> Best regards,
> Karl
>
Forgot to close the socket when program finishes, this is why the second run always failed. Now it works :)
I thought that the socket will be closed automatically when the program exits, as this is the case in POSIX?!
Is there a reason why this is not done in RTnet? Or would there be a possibility to give at least a warning that there are still open sockets, when a program exits? This would prevent others to get the same issues.
Thanks for all your input!
Karl
--
von Karl Reichert
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-help] Problems with Threads and RTnet
2008-06-30 8:40 ` Karl Reichert
@ 2008-06-30 13:49 ` Gilles Chanteperdrix
2008-07-01 7:45 ` Karl Reichert
0 siblings, 1 reply; 10+ messages in thread
From: Gilles Chanteperdrix @ 2008-06-30 13:49 UTC (permalink / raw)
To: Karl Reichert; +Cc: xenomai, rtnet-users
Karl Reichert wrote:
> Forgot to close the socket when program finishes, this is why the
> second run always failed. Now it works :)
>
> I thought that the socket will be closed automatically when the
> program exits, as this is the case in POSIX?! Is there a reason why
> this is not done in RTnet?
RTDM should do it with Xenomai 2.4. Are you sure you are not using an
older version of the kernel-space support ?
--
Gilles.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-help] Problems with Threads and RTnet
2008-06-30 13:49 ` Gilles Chanteperdrix
@ 2008-07-01 7:45 ` Karl Reichert
2008-07-01 8:47 ` Jan Kiszka
0 siblings, 1 reply; 10+ messages in thread
From: Karl Reichert @ 2008-07-01 7:45 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
> > Forgot to close the socket when program finishes, this is why the
> > second run always failed. Now it works :)
> >
> > I thought that the socket will be closed automatically when the
> > program exits, as this is the case in POSIX?! Is there a reason why
> > this is not done in RTnet?
>
> RTDM should do it with Xenomai 2.4. Are you sure you are not using an
> older version of the kernel-space support ?
No, I'm using Xenomai 2.4.3 without any additional patches, so there is no older version of kernel-space support installed.
--
von Karl Reichert
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-help] Problems with Threads and RTnet
2008-07-01 7:45 ` Karl Reichert
@ 2008-07-01 8:47 ` Jan Kiszka
2008-07-01 14:11 ` Karl Reichert
0 siblings, 1 reply; 10+ messages in thread
From: Jan Kiszka @ 2008-07-01 8:47 UTC (permalink / raw)
To: Karl Reichert; +Cc: xenomai
Karl Reichert wrote:
>>> Forgot to close the socket when program finishes, this is why the
>>> second run always failed. Now it works :)
>>>
>>> I thought that the socket will be closed automatically when the
>>> program exits, as this is the case in POSIX?! Is there a reason why
>>> this is not done in RTnet?
>> RTDM should do it with Xenomai 2.4. Are you sure you are not using an
>> older version of the kernel-space support ?
>
> No, I'm using Xenomai 2.4.3 without any additional patches, so there is no older version of kernel-space support installed.
If you have a simple test program, I would be glade to cross-check here.
Moreover, you could have a look at /proc/xenomai/rtdm/open_fildes before
and after closing your app. It should give an overview on all open
descriptors. If they are stalled after closing your RTnet app, this is
definitely a bug that has to be understood and fixed.
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-help] Problems with Threads and RTnet
2008-07-01 8:47 ` Jan Kiszka
@ 2008-07-01 14:11 ` Karl Reichert
0 siblings, 0 replies; 10+ messages in thread
From: Karl Reichert @ 2008-07-01 14:11 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai
> >>> Forgot to close the socket when program finishes, this is why the
> >>> second run always failed. Now it works :)
> >>>
> >>> I thought that the socket will be closed automatically when the
> >>> program exits, as this is the case in POSIX?! Is there a reason why
> >>> this is not done in RTnet?
> >> RTDM should do it with Xenomai 2.4. Are you sure you are not using an
> >> older version of the kernel-space support ?
> >
> > No, I'm using Xenomai 2.4.3 without any additional patches, so there is
> no older version of kernel-space support installed.
>
> If you have a simple test program, I would be glade to cross-check here.
>
> Moreover, you could have a look at /proc/xenomai/rtdm/open_fildes before
> and after closing your app. It should give an overview on all open
> descriptors. If they are stalled after closing your RTnet app, this is
> definitely a bug that has to be understood and fixed.
>
> Jan
>
After a deeper look I found out, that we are using Xenomai 2.3.2, not 2.4.x
So the socket has to be manually closed.
After doing so, /proc/xenomai/rtdm/open_fildes shows no more open descriptors.
So everything is fine, thanks for your help!
Karl
--
von Karl Reichert
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-07-01 14:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-25 15:49 [Xenomai-help] Problems with Threads and RTnet Karl Reichert
2008-06-25 15:56 ` Gilles Chanteperdrix
2008-06-26 4:01 ` [Xenomai-help] how to make my own application in Xenomai indra sakti
2008-06-26 6:41 ` Gilles Chanteperdrix
-- strict thread matches above, loose matches on Subject: below --
2008-06-26 10:03 [Xenomai-help] Problems with Threads and RTnet Karl Reichert
2008-06-30 8:40 ` Karl Reichert
2008-06-30 13:49 ` Gilles Chanteperdrix
2008-07-01 7:45 ` Karl Reichert
2008-07-01 8:47 ` Jan Kiszka
2008-07-01 14:11 ` Karl Reichert
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.