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 noted in nasa/cFE#948, there are cases in CFE where a mutex may be taken by the same task more than once. This is technically allowed because OSAL enables recursive mutexes for all supported OS types.
But my concern is that:
recursive mutexes aren't guaranteed to be provided - i.e. some minimal RTOS's might not have this facility at all.
if recursive mutexes are provided, they are slower than the normal (non-recursive) counterpart.
anything that depends on recursive mutexes generally indicates deeper code design flaws - i.e. insufficient separation of internal vs. external APIs, function loops, circular subsystem dependencies, etc.
Describe the solution you'd like
Start by introducing an OS_DEBUG warning if the same task takes a mutex more than once. This can help identify the issues, and it is very easy to add. It also won't be displayed unless OSAL is compiled with debug messages enabled.
Additional context
A future / follow up change, once dependencies on recursive mutexes are fix, could be to allow the user to optionally elect to use non-recursive/fast mutexes via an osconfig option.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
if OS_DEBUG is enabled, this adds a message if mutex give/take
actions occur outside the expected sequence. In particular,
this warns if a task takes a mutex more than once.
Is your feature request related to a problem? Please describe.
As noted in nasa/cFE#948, there are cases in CFE where a mutex may be taken by the same task more than once. This is technically allowed because OSAL enables recursive mutexes for all supported OS types.
But my concern is that:
Describe the solution you'd like
Start by introducing an
OS_DEBUG
warning if the same task takes a mutex more than once. This can help identify the issues, and it is very easy to add. It also won't be displayed unless OSAL is compiled with debug messages enabled.Additional context
A future / follow up change, once dependencies on recursive mutexes are fix, could be to allow the user to optionally elect to use non-recursive/fast mutexes via an osconfig option.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: