Skip to contentSkip to conversation

rt_task_create and rt_task delete re-scheduling calling task

Xenomai-core Roberto Bielli 3 participants 4 messages May 14, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

i saw in the documentation that rt_task_create and rt_task_delete should re-scheduling the calling task.
So i lost the priority if in a task try to call rt_task_create or rt_task create. Do i understand correctly ? Is there a way to avoid this behaviour ? Or which are all the case of re-scheduling whne calling rt_task_create/rt_task_delete ?

Thanks of all

P.S. the imx25 now it's perfect. Was only the reentrant interrupt.

Signature · 33 lines
+------------------------------------------------------------------------------------------------+
							
Roberto Bielli
Sviluppo Software					
Axel S.r.l.					
							
Via Del Cannino, 3 				
21020 Crosio Della Valle			
Varese - Italy					
							
Telefono: +39 0332 949600			
Fax:      +39 0332 969315			
							
E-mail:   [email protected]	
Web Site: www.axelsw.it

+------------------------------------------------------------------------------------------------+

Si precisa che le informazioni contenute in questo messaggio sono riservate e ad uso esclusivo del destinatario.
Qualora il messaggio in parola Le fosse pervenuto per errore, La preghiamo di eliminarlo senza copiarlo e di non inoltrarlo a terzi,
dandocene gentilmente comunicazione. Grazie.
Informativa sul trattamento dei dati personali (D. Lgs. 196/2003).
I dati utilizzati per la spedizione del presente messaggio sono utilizzati da Axel S.r.l., titolare del trattamento,
per l'invio delle comunicazioni dei diversi settori aziendali, non essendo autorizzata la divulgazione a terzi.
Potrete rivolgere alla seguente mail richieste di verifica, rettifica o cancellazione dei Vostri dati: [email protected]

This e-mail and any attachments is confidential and may contain privileged information
intended for the addressee(s) only. Dissemination, copying, printing or use by anybody
else is unauthorised. If you are not the intended recipient,
please delete this message and any attachments and advise the sender
by return e-mail.Thank you.  			
							
+------------------------------------------------------------------------------------------------+
#1 lore raw
Quoted 4 lines · Roberto Bielli

Hi,

i saw in the documentation that rt_task_create and rt_task_delete should re-scheduling the calling task.

rt_task_create may reschedule the calling task, only "may", not "should". And it happens in the obvious case: when creating a task with a higher priority than the current task.

The reason why rt_task_delete may reschedule is documented:
"Native tasks implement a mechanism by which they are immune from deletion by other tasks while they run into a deemed safe section of code. This feature is used internally by the native skin in order to prevent tasks from being deleted in the middle of a critical section, without resorting to interrupt masking when the latter is not an option. For this reason, the caller of rt_task_delete() might be blocked and a rescheduling take place, waiting for the target task to exit such critical section."

Xenomai online documentation may be found here:
http://www.xenomai.org/documentation/xenomai-2.6/html/api/index.html

And a local copy is installed when you run xenomai package "make install".

Signature · 1 line
                                                                Gilles.
#2 lore raw
In reply to Roberto Bielli
Quoted 8 lines · Roberto Bielli

Hi,

i saw in the documentation that rt_task_create and rt_task_delete should re-scheduling the calling task.
So i lost the priority if in a task try to call rt_task_create or rt_task create. Do i understand correctly ?
Is there a way to avoid this behaviour ? Or which are all the case of re-scheduling whne calling rt_task_create/rt_task_delete ?

There is no way to avoid rescheduling (assuming you are currently using the user-space API). Creating and deleting tasks involves switching to secondary mode to get/release linux resources it's impossible to access from a primary context.

Quoted 5 lines

Thanks of all

P.S. the imx25 now it's perfect. Was only the reentrant interrupt.

Signature · 1 line
Philippe.
#3 lore raw
In reply to Roberto Bielli
Quoted 1 line · Roberto Bielli

P.S. the imx25 now it's perfect. Was only the reentrant interrupt.

By the way, now that Linux runs all interrupt handlers with hardware irq disabled, this option is completely useless: it will prevent a low priority irq to interrupt a low priority irq while the high priority interrupt handler is running, but since that handler is already running with hardware interrupts off, this does not add anything.

Signature · 1 line
					    Gilles.