* Xenomai - VxWorks Emulator - Implementation of taskWait()
@ 2021-05-28 7:40 MONTET Julien
2021-05-30 8:00 ` Philippe Gerum
0 siblings, 1 reply; 3+ messages in thread
From: MONTET Julien @ 2021-05-28 7:40 UTC (permalink / raw)
To: Xenomai
Hi the developers,
I already succeeded to use Xenomai with API/libraires such as Alchemy and Posix.
My goal is now to use the VxWorks API.
I don't have any issue to include path/librairies but I am trying to use the function "taskWait" (used by VxWorks) that is not present in Xenomai-VxWorks.
https://docs.windriver.com/fr-FR/bundle/vxworks_7_application_core_os_sr0630-enus/page/CORE/taskLib.html#taskWait
https://xenomai.org/documentation/xenomai-3/html/xeno3prm/include_2vxworks_2taskLib_8h_source.html
I don't really know if this function is obvious or if a similar code could run on Xenomai.
Could you advise a way to implement something that looks like taskWait ?
Could rt_task_wait_period<https://xenomai.org/documentation/xenomai-3/html/xeno3prm/group__alchemy__task.html#ga1645d3a072ef3cefeed3bcbb27dcf108> from Alchemy (task.h) be an interesting solution ?
Regards,
Julien
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Xenomai - VxWorks Emulator - Implementation of taskWait()
2021-05-28 7:40 Xenomai - VxWorks Emulator - Implementation of taskWait() MONTET Julien
@ 2021-05-30 8:00 ` Philippe Gerum
2021-05-31 7:11 ` MONTET Julien
0 siblings, 1 reply; 3+ messages in thread
From: Philippe Gerum @ 2021-05-30 8:00 UTC (permalink / raw)
To: MONTET Julien; +Cc: xenomai
MONTET Julien via Xenomai <xenomai@xenomai.org> writes:
> Hi the developers,
>
> I already succeeded to use Xenomai with API/libraires such as Alchemy and Posix.
> My goal is now to use the VxWorks API.
> I don't have any issue to include path/librairies but I am trying to use the function "taskWait" (used by VxWorks) that is not present in Xenomai-VxWorks.
> https://docs.windriver.com/fr-FR/bundle/vxworks_7_application_core_os_sr0630-enus/page/CORE/taskLib.html#taskWait
> https://xenomai.org/documentation/xenomai-3/html/xeno3prm/include_2vxworks_2taskLib_8h_source.html
>
> I don't really know if this function is obvious or if a similar code could run on Xenomai.
taskWait() is roughly equivalent to pthread_join() with WAIT_FOREVER as
a timeout. Dealing with a valid timeout would be tricky though, since
POSIX does not provide support for this, neither does libcobalt for this
reason.
[Cobalt core] <- kernel, implements syscalls from libcobalt.so
^
[libcobalt] <- POSIX API (lib/cobalt)
^
[libcopperplate] <- building blocks for non-POSIX APIs (common RTOS API patterns)
^
[VxWorks] <- VxWorks emulation
There is no provision for join-with-timeout in either libcopperplate or
libcobalt at the moment. If your *libc is recent enough, you could
implement pthread_tryjoin() in libcobalt (lib/cobalt/thread.c) as a
variation of the existing pthread_join(), which would use the native
pthread_tryjoin(3) instead of pthread_join(3) to have the caller wait
for the thread to exit, finalizing the operation by a call to
cobalt_thread_join().
> Could you advise a way to implement something that looks like taskWait ?
> Could rt_task_wait_period<https://xenomai.org/documentation/xenomai-3/html/xeno3prm/group__alchemy__task.html#ga1645d3a072ef3cefeed3bcbb27dcf108> from Alchemy (task.h) be an interesting solution ?
>
No, this is not related. rt_task_wait_period() waits for the next wakeup
in a periodic timeline started by rt_task_set_periodic().
--
Philippe.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Xenomai - VxWorks Emulator - Implementation of taskWait()
2021-05-30 8:00 ` Philippe Gerum
@ 2021-05-31 7:11 ` MONTET Julien
0 siblings, 0 replies; 3+ messages in thread
From: MONTET Julien @ 2021-05-31 7:11 UTC (permalink / raw)
To: Philippe Gerum; +Cc: xenomai
Hello Philippe,
Thank you for your answer and all of your explainations !
I understand now the next steps I need to follow.
Regards,
Julien
________________________________
De : Philippe Gerum <rpm@xenomai.org>
Envoyé : dimanche 30 mai 2021 10:00
À : MONTET Julien <julien.montet@reseau.eseo.fr>
Cc : xenomai@xenomai.org <xenomai@xenomai.org>
Objet : Re: Xenomai - VxWorks Emulator - Implementation of taskWait()
MONTET Julien via Xenomai <xenomai@xenomai.org> writes:
> Hi the developers,
>
> I already succeeded to use Xenomai with API/libraires such as Alchemy and Posix.
> My goal is now to use the VxWorks API.
> I don't have any issue to include path/librairies but I am trying to use the function "taskWait" (used by VxWorks) that is not present in Xenomai-VxWorks.
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.windriver.com%2Ffr-FR%2Fbundle%2Fvxworks_7_application_core_os_sr0630-enus%2Fpage%2FCORE%2FtaskLib.html%23taskWait&data=04%7C01%7Cjulien.montet%40reseau.eseo.fr%7Cf85369ae235840b9093a08d9234113bb%7C4d7ad1591265437ab9f62946247d5bf9%7C0%7C0%7C637579584692348260%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=12Vr5F7HQUaNjI2PUH%2FjGiVmLCQDCTuJgjnrzvQ370o%3D&reserved=0
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fxenomai.org%2Fdocumentation%2Fxenomai-3%2Fhtml%2Fxeno3prm%2Finclude_2vxworks_2taskLib_8h_source.html&data=04%7C01%7Cjulien.montet%40reseau.eseo.fr%7Cf85369ae235840b9093a08d9234113bb%7C4d7ad1591265437ab9f62946247d5bf9%7C0%7C0%7C637579584692358215%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=om%2B3dyMdJMqMt%2FsrXdtBCXARoa7dPIkd0TWLx3hmVwI%3D&reserved=0
>
> I don't really know if this function is obvious or if a similar code could run on Xenomai.
taskWait() is roughly equivalent to pthread_join() with WAIT_FOREVER as
a timeout. Dealing with a valid timeout would be tricky though, since
POSIX does not provide support for this, neither does libcobalt for this
reason.
[Cobalt core] <- kernel, implements syscalls from libcobalt.so
^
[libcobalt] <- POSIX API (lib/cobalt)
^
[libcopperplate] <- building blocks for non-POSIX APIs (common RTOS API patterns)
^
[VxWorks] <- VxWorks emulation
There is no provision for join-with-timeout in either libcopperplate or
libcobalt at the moment. If your *libc is recent enough, you could
implement pthread_tryjoin() in libcobalt (lib/cobalt/thread.c) as a
variation of the existing pthread_join(), which would use the native
pthread_tryjoin(3) instead of pthread_join(3) to have the caller wait
for the thread to exit, finalizing the operation by a call to
cobalt_thread_join().
> Could you advise a way to implement something that looks like taskWait ?
> Could rt_task_wait_period<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fxenomai.org%2Fdocumentation%2Fxenomai-3%2Fhtml%2Fxeno3prm%2Fgroup__alchemy__task.html%23ga1645d3a072ef3cefeed3bcbb27dcf108&data=04%7C01%7Cjulien.montet%40reseau.eseo.fr%7Cf85369ae235840b9093a08d9234113bb%7C4d7ad1591265437ab9f62946247d5bf9%7C0%7C0%7C637579584692358215%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=BZNXcdami%2BxdXZ5kpOuSGA4jQlVwu6CxKIXPjNsVz30%3D&reserved=0> from Alchemy (task.h) be an interesting solution ?
>
No, this is not related. rt_task_wait_period() waits for the next wakeup
in a periodic timeline started by rt_task_set_periodic().
--
Philippe.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-31 7:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28 7:40 Xenomai - VxWorks Emulator - Implementation of taskWait() MONTET Julien
2021-05-30 8:00 ` Philippe Gerum
2021-05-31 7:11 ` MONTET Julien
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.