SCHED_SPORADIC: Why ss_initial_budget is not 'respected' ?

Alex kbyte at iol.pt
Mon May 23 09:42:11 UTC 2005


Hi all,

I am using the SCHED_SPORADIC policy in a POSIX test program but the ss_initial_budget time
seems not to be respected.

What I want is to execute the sporadic thread during 10,25 seconds (ss_initial_budget) 
and to "pause" the execution of that thread for 10,5 seconds (ss_replenish_period).


In order to have time to see things in screen I configured:

microseconds per tick 1000000
ticks per time slice  1

 
Here the pseudo-code of the  test program:


Worker_Thread()
{
   while(1)
   {
      printk(" BkGrd Thread ");
   }
}


Main()
{
   param.ss_replenish_period.tv_sec=10;
   param.ss_replenish_period.tv_nsec=500000000;
   param.ss_initial_budget.tv_sec=10;
   param.ss_initial_budget.tv_sec=250000000;

   schparam.sched_priority=254
   schparam.ss_low_priority=1
 
   pthread_setschedparam(pthread_self(), SCHED_SPORADIC, &schparam)

   Launch the Worker_Thread with priority 50 and SCHED_FIFO as policy

   while(1)
   {
      printk(" Main Thread ");
   }
}


I can see in the screen "Main Thread" written during 10 seconds but the words "BkGrd Thread" are written in the 
screen only during 1 or 2 seconds. 
Why Worker_Thread() doesnt executes during all the replenish period of the main thread?

Could we mix SCHED_SPORADIC threads and FIFO threads in the same program?


Many thanks,

Alex






_________________________________________________________________________________
NOVO! Filtro de Anti-SPAM IOL reduz o lixo na sua caixa de correio em mais de 80%
Servicos IOL COMPLETO e IOL SEGURO.
Saiba Mais em http://www.iol.pt/correio/rodape.php?dst=0505121




More information about the users mailing list