From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4EBA5585.8050807@domain.hid> Date: Wed, 09 Nov 2011 11:27:17 +0100 From: Olivier Reynet MIME-Version: 1.0 References: <51962.81.220.196.189.1320786408.squirrel@domain.hid> <4EB9C562.9040107@domain.hid> In-Reply-To: <4EB9C562.9040107@domain.hid> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Xenomai-help] Xenomai 2.5.6 and Round Robin List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: xenomai@xenomai.org OK, I understand that it is rt_task_slice that must be used. The problem is that i dont see any RR effect during execution. The code is simple and inspired by this no more suitable but useful code=20 : http://www.cs.ru.nl/lab/xenomai/exercises/ex06/ex06a.c . 4 non periodic tasks are set. They are calling rt_timer_spin(SPINTIME)=20 to do nothing during EXECTIME. 1. They are set with priority 60. 2. Then the RR quantum is set to 3*SPINTIME. I would like to see the task 0 preempted but it is not. It looks like=20 FIFO scheduling without RR. Here below is the code and the output follows : #include #include #include #include #include #include #include #include #include #define NTASKS 4 RT_TASK demo_task[NTASKS]; RT_SEM mysync; #define EXECTIME 2e7 // execution time in ns =3D=3D> 20 ms #define SPINTIME 1e6 // spin time in ns =3D=3D> 1 ms void demo(void *arg) { RTIME runtime; runtime =3D 0; rt_sem_p(&mysync,TM_INFINITE); // inquire current task RT_TASK *curtask; RT_TASK_INFO curtaskinfo; curtask=3DNULL; rt_task_inquire(curtask,&curtaskinfo); while(curtaskinfo.exectime< EXECTIME) { rt_timer_spin(SPINTIME); // spin cpu doing nothing rt_task_inquire(curtask,&curtaskinfo); rt_printf("Running %s priority[%d] at : %d ms\n",curtaskinfo.name= ,curtaskinfo.cprio,curtaskinfo.exectime/1000000); } rt_printf("End of %s\n",curtaskinfo.name); } //startup code void startup() { int i; char str[10] ; RT_TASK_INFO ataskinfo; // semaphore to sync task startup on rt_sem_create(&mysync,"MySemaphore",0,S_FIFO); // starting tasks for(i=3D0;i See also ksrc/skins/native/API.CHANGES in xeny omai sources.