You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Against coding standards to implement code in a header.
Same function is defined 20 times.
The task has no blocking statement at all, so it spins using 100% cpu after it is started.
On some operating systems (e.g. POSIX), unless async task cancellation is enabled this also means the task also cannot be deleted, because it will never execute a cancellation point.
Although the osal-core-test program passes and attempts to delete these tasks, in reality they keep running on POSIX and do not actually exit.
To Reproduce
View in a debugger after creating + deleting these tasks - the threads are still there. CPU usage is also very high (e.g. 300%) for the remainder of the test because these tasks are spinning and do not exit.
Expected behavior
There is no need to redefine the same function. Recommend to use the task_generic_no_exit() function (which already exists) for all of these tasks. This function also uses OS_TaskDelay() so it does not consume max CPU and also this serves as a cancellation point thus allowing the task to be deleted normally.
System observed on:
Ubuntu 20.04
Additional context
This becomes a bigger issue when #642 is done, as the tasks effectively are un-deletable.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
jphickey
added a commit
to jphickey/osal
that referenced
this issue
Dec 7, 2020
Move all definitions and instantiations out of the header file.
Reuse the single task definition that was already defined.
Also only define 3 instances of each type, as this is all that
the test actually uses (no need for 20).
Describe the bug
The
osal-core-test.c
refers to task functions that are actually defined (not just declared) inosal-core-test.h
Furthermore, these tasks just implement a tight loop:
osal/src/tests/osal-core-test/osal-core-test.h
Lines 254 to 262 in fa0cffa
Multiple Problems:
Although the
osal-core-test
program passes and attempts to delete these tasks, in reality they keep running on POSIX and do not actually exit.To Reproduce
View in a debugger after creating + deleting these tasks - the threads are still there. CPU usage is also very high (e.g. 300%) for the remainder of the test because these tasks are spinning and do not exit.
Expected behavior
There is no need to redefine the same function. Recommend to use the
task_generic_no_exit()
function (which already exists) for all of these tasks. This function also usesOS_TaskDelay()
so it does not consume max CPU and also this serves as a cancellation point thus allowing the task to be deleted normally.System observed on:
Ubuntu 20.04
Additional context
This becomes a bigger issue when #642 is done, as the tasks effectively are un-deletable.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: