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
Is your feature request related to a problem? Please describe.
As a follow on to previous PR #678, this implements a new "impl" function which waits for a global table change to complete using an OS-specific primitive. But only POSIX/pthreads was initially updated to use a proper wait primitive for this operation. For VxWorks and RTEMS, these continue to use a simple unlock - task delay - re-lock and poll for the change.
This works but can potentially introduce noticable extra/unnecessary delay. In particular, during task startup the parent task is using the accessing record at the same time the child starts up and also needs to access the same record. Therefore the child task will hit this wait condition. On POSIX the child resumes immediately once the parent task has completed its use of the record. But currently for VxWorks and RTEMS they must wait for the Task Delay to expire.
Describe the solution you'd like
Need to investigate/consider the various sync primitives that the OS provides, and use something more appropriate that will not add extra unnecessary delay or polling.
Describe alternatives you've considered
Keep polling. It isn't "broken" in a strict sense - the contention should be resolved and the right thing will happen after the delay expires. It's just not what the user might expect (that is, there might be a millisecond or two delay between OS_TaskCreate returning and the user task actually running).
Additional context
RTEMS Barrier might be an option. However I do not see any way to sync a barrier with a condition (like a POSIX condition variable) - so these leave open the possibility that the other task finishes its operation just before the current task is about to wait - meaning it will end up waiting for an event that has already happened.
But so long as a timeout is also used, that means it will just fall back to the timeout - so if this happens its not worse than what is implemented now.
Originally discussed in review of #678 at CCB 2020-12-09
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
When cleaning up a task the child task resources should be
cleaned first, followed by the main task resources.
This is because child tasks are also associated with the original
creator within OSAL and will be found through OSAL ForEachObject,
and also via links within the ES task table.
By cleaning child tasks first, this avoids attempting to delete
the child task twice.
jphickey
pushed a commit
to jphickey/osal
that referenced
this issue
Aug 10, 2022
Is your feature request related to a problem? Please describe.
As a follow on to previous PR #678, this implements a new "impl" function which waits for a global table change to complete using an OS-specific primitive. But only POSIX/pthreads was initially updated to use a proper wait primitive for this operation. For VxWorks and RTEMS, these continue to use a simple unlock - task delay - re-lock and poll for the change.
This works but can potentially introduce noticable extra/unnecessary delay. In particular, during task startup the parent task is using the accessing record at the same time the child starts up and also needs to access the same record. Therefore the child task will hit this wait condition. On POSIX the child resumes immediately once the parent task has completed its use of the record. But currently for VxWorks and RTEMS they must wait for the Task Delay to expire.
Describe the solution you'd like
Need to investigate/consider the various sync primitives that the OS provides, and use something more appropriate that will not add extra unnecessary delay or polling.
Describe alternatives you've considered
Keep polling. It isn't "broken" in a strict sense - the contention should be resolved and the right thing will happen after the delay expires. It's just not what the user might expect (that is, there might be a millisecond or two delay between OS_TaskCreate returning and the user task actually running).
Additional context
RTEMS Barrier might be an option. However I do not see any way to sync a barrier with a condition (like a POSIX condition variable) - so these leave open the possibility that the other task finishes its operation just before the current task is about to wait - meaning it will end up waiting for an event that has already happened.
But so long as a timeout is also used, that means it will just fall back to the timeout - so if this happens its not worse than what is implemented now.
Originally discussed in review of #678 at CCB 2020-12-09
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: