Re: rt_task_unblock() POSIX alternative

Petr Červenka grugh at centrum.cz
Tue Apr 7 17:18:16 CEST 2020


Hello Jan.
And if I don't want to totally remove the thread? Only to interrupt the waiting and react according to new events (like reconfiguring something or starting to wait on different resource).
Is there some pthread_create... or sched_... parameter or flag, that the task's system call can be interruptible?
And how to use the signals to interrupt it? Call of kill(task_pid, SIGINT) didn't helped.
Petr
 
______________________________________________________________
> From "Jan Kiszka" <jan.kiszka at siemens.com>
>
On 07.04.20 15:41, Petr Červenka via Xenomai wrote:
 > Hello everyone.
 > I there a rt_task_unblock() Xenomai POSIX skin alternative?
 > I created an example of periodic POSIX task, similar to the latency example but with very long period. When I receive a INT signal I set the end flag and I would like to unblock a task that waits on read(timerfd). But all my attempts led to standard wait timeout or worse.
 
 Try pthread_cancel(). If you need to run some cleanup code in the target 
 thread, use pthread_cleanup_push. None of that would be with real-time 
 qualities, though. But I assume that the cleanup is not a time-critical 
 path, is it?
 
 Sending a Linux signal would be another way to interrupt the target task.
 
 Jan
 
 -- 
 Siemens AG, Corporate Technology, CT RDA IOT SES-DE
 Corporate Competence Center Embedded Linux



More information about the Xenomai mailing list