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.
For a number of resource create/delete operations, they may take some non-deterministic amount of time to execute in the system, and may require obtaining some type of mutex in the underlying C library too (e.g. if something invokes malloc). This is especially true of creating and deleting tasks, which may need to malloc() memory for the stack, and need to create a new task resource in the kernel.
Because of this, OSAL should not hold its own global table mutex while the whole operation takes place, as this will also prevent other unrelated ops from completing.
Describe the solution you'd like
These operations should reserve an entry in the table but mark it as reserved, not with a normal ID (so distinct from a normal entry). It can then unlock the global table and complete the non-deterministic parts of the operation, then re-lock when complete.
Additional context
This is required for #642, already have it implemented but felt it was worth splitting into a separate issue/commit for tracking purposes.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
This becomes important/relevant for #642 because OS_TaskDelete will need to block the caller until the task actually exits, and OSAL should always avoid blocking while holding the mutex.
jphickey
added a commit
to jphickey/osal
that referenced
this issue
Dec 22, 2020
Change the EXCLUSIVE lock type such that it sets the ID in the global
table to RESERVED and unlocks the global before returning to the caller.
This allows the potentially long-running operation to complete and
not block other operations from happening in other tasks.
Use the EXCLUSIVE lock for all create/delete ops as well as for
bind and connect socket ops.
Also implement a new "RESERVED" lock to handle a special case in the
vxworks timebase implementation where the impl layer needs to acquire
a token for an object as it is being created. This case is special
because it needs to happen during OS_TimeBaseCreate, and cannot be
completed after the fact like normal tasks, because it is a factor
in determining the success/fail status of the overall operation.
Is your feature request related to a problem? Please describe.
For a number of resource create/delete operations, they may take some non-deterministic amount of time to execute in the system, and may require obtaining some type of mutex in the underlying C library too (e.g. if something invokes malloc). This is especially true of creating and deleting tasks, which may need to malloc() memory for the stack, and need to create a new task resource in the kernel.
Because of this, OSAL should not hold its own global table mutex while the whole operation takes place, as this will also prevent other unrelated ops from completing.
Describe the solution you'd like
These operations should reserve an entry in the table but mark it as reserved, not with a normal ID (so distinct from a normal entry). It can then unlock the global table and complete the non-deterministic parts of the operation, then re-lock when complete.
Additional context
This is required for #642, already have it implemented but felt it was worth splitting into a separate issue/commit for tracking purposes.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: