I’m playing around with APS. What I want is to have a thread running in a budget of 20%.
Testing : 20
I wanted to test if the critical thread is fired when the 20% level is reached. The testing partition has only one thread running doing a while(1).
When I do a aps show, the free time of the system partition is given to the testing partition.
- Will the cirtical thread execute when it reaches the 20%? Or will the free time of the system partition cancel this out? (I hope not!)
- How do I create a critical thread?
What have now is this:
creation_data.budget_percent = 20; creation_data.critical_budget_ms = 10; creation_data.name = "testing"; coid = ChannelCreate(0); event.sigev_notify=SIGEV_PULSE;
ret = SchedCtl( SCHED_APS_CREATE_PARTITION, &creation_data,
All goes well next i create two threads and make them join the partition, one is the ‘normal’ thread that contains the while loop and the other one I mark as critical:
join_partition(); /* this goes fine */
join_partition(); /*goes fine)
ret = SchedCtl(SCHED_APS_MARK_CRITICAL,&crit,sizeof(crit));
/* ret returns okay */
printf(" critical thread running\n" ) /* never gets here! */