RTEMS tasks timesliced instead of running to completion. TIMESLICE flag is not active!
Thanassis Tsiodras (external)
Thanassis.Tsiodras at esa.int
Fri May 1 09:10:19 UTC 2020
The complete code of the two tasks is here:
https://gitrepos.estec.esa.int/ttsiodras/RTEMS-build-workflows/-/blob/master/OAR/src/task1.c
and here:
https://gitrepos.estec.esa.int/ttsiodras/RTEMS-build-workflows/-/blob/master/OAR/src/task2.c
...so the short answer is that, besides what you already mentioned...
none.
Thanassis Tsiodras
Real-time Embedded Software Engineer
System, Software and Technology Department
ESTEC
Keplerlaan 1, PO Box 299
NL-2200 AG Noordwijk, The Netherlands
Thanassis.Tsiodras at esa.int | www.esa.int
T +31 71 565 5332
From: "Thomas Doerfler" <Thomas.Doerfler at imd-systems.de>
To: users at rtems.org
Date: 01/05/2020 10:59
Subject: Re: RTEMS tasks timesliced instead of running to
completion. TIMESLICE flag is not active!
Sent by: "users" <users-bounces at rtems.org>
Fernando,
a second guess: which systems calls are you doing in your Task1 and
task2? Obviously your are sending events (which is not preempting) and
doing console output (which is questionable regarding preemption), but
which other calls are involved?
wkr,
Thomas.
Am 30.04.20 um 17:14 schrieb Fernando Domínguez Pousa:
> Hello,
>
>
>
> I am executing a program which executes four different task with testing
> operations. These tasks were created and launched in this way:
>
>
>
> status = rtems_task_create(Task_name[i], (rtems_task_priority) 2,
> RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES,
>
> (i%2) == 0 ? RTEMS_FLOATING_POINT :
> RTEMS_DEFAULT_ATTRIBUTES, &Task_id[i]);
>
>
>
> status = rtems_task_start(Task_id[i], (i%2) == 0 ? Task1_EntryPoint :
> Task2_EntryPoint, i);
>
>
>
> As you can see all task are created with the same priority, and launched
> one after the other inside a for loop. They are configured in default
> modes, so time slicing is disabled by default (all mode bits are 0).
> This result would be expected due to each task would run-to-completion
> because all tasks have the same priority:
>
>
>
> The expected result:
>
> [MAIN] Waiting for testing tasks to complete...
>
> [TASK 0] Starting...
>
> [TASK 0] Computed the correct floating point result.
>
> [TASK 1] Starting...
>
> [TASK 1] Computed the correct integer result.
>
> [TASK 2] Starting...
>
> [TASK 2] Computed the correct floating point result.
>
> [TASK 3] Starting...
>
> [TASK 3] Computed the correct integer result.
>
> [MAIN] All testing tasks completed.
>
>
>
> Nevertheless, using RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_MODES |
> RTEMS_TIMESLICE or RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT either as
> rtems_mode, the result is always the same.
>
>
>
> The actual result:
>
> [MAIN] Waiting for testing tasks to complete...
>
> [TASK 0] Starting...
>
> [TASK 1] Starting...
>
> [TASK 2] Starting...
>
> [TASK 3] Starting...
>
> [TASK 0] Computed the correct floating point result.
>
> [TASK 1] Computed the correct integer result.
>
> [TASK 2] Computed the correct floating point result.
>
> [TASK 3] Computed the correct integer result.
>
> [MAIN] All testing tasks completed.
>
>
>
> At RTEMS API Guide:
>
>
>
> The timeslicing component is used by the RTEMS scheduler to determine
> how the processor is allocated to tasks of equal priority. If
> timeslicing is enabled (RTEMS_TIMESLICE), then RTEMS will limit the
> amount of time the task can execute before the processor is allocated to
> another ready task of equal priority.
>
>
>
> *The length of the timeslice is application dependent and specified in
> the Configuration Table. If timeslicing is disabled
> (**RTEMS_NO_TIMESLICE**), then the task will be allowed to execute until
> a task of higher priority is made ready. *However I have not any task
> with higher priority, Init task priority is lower.
>
>
>
> If RTEMS_NO_PREEMPT is selected, then the timeslicing component is
> ignored by the scheduler.
>
>
>
> How can I execute this tasks in a run to completion fashion for same
> priority tasks? Task 0 starts and ends, then Task1 starts and ends… etc,
>
>
>
> Regards,
>
>
>
> Fer.
>
>
>
>
> PPlease consider the environment before printing this e-mail.
>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
>
--
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler Herbststrasse 8
D-82178 Puchheim Germany
email: Thomas.Doerfler at imd-systems.de
PGP public key available on request
_______________________________________________
users mailing list
users at rtems.org
http://lists.rtems.org/mailman/listinfo/users
This message is intended only for the recipient(s) named above. It may contain proprietary information and/or
protected content. Any unauthorised disclosure, use, retention or dissemination is prohibited. If you have received
this e-mail in error, please notify the sender immediately. ESA applies appropriate organisational measures to protect
personal data, in case of data privacy queries, please contact the ESA Data Protection Officer (dpo at esa.int).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20200501/89b5eb94/attachment-0001.html>
More information about the users
mailing list