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
Description of the bug:
The mutex was acquired by lower priority thread and performing its thread activity and not yet released the mutex. When higher priority thread is trying to acquire the same mutex, still _tx_mutex_get() function call return TX_SUCCESS. So higher priority thread perform its thread activity and releasing the mutex. When mutex released from higher priority thread, _tx_mutex_put() function returned the value TX_NOT_OWNED. Because the mutex owner is lower priority thread. Due to TX_NOT_OWNED return value, our firmware is designed to generate software assertion.
Additional information:
Target - MIPS Interaptiv SMP CPU
Eclipse ThreadX version - threadx-6.4.1_rel
Compiler - GHS Multi compiler
Initially we tested our application in 50 MHz CPU clock. The application is working fine.
When we test our application in 1.1 GHz (1100 MHz) CPU clock, this issue is observed.
We debugged the issue and found the root cause. Working scenario:
When higher priority thread try to get already acquired mutex, higher priority thread moved to suspended state and lower priority thread is continued its operation.
Non-working scenario:
When higher priority thread try to get already acquired mutex, higher priority thread is not moved to suspended state and keeps on running because of below "if" condition fail in _tx_thread_system_suspend() function.
/* Determine if preemption should take place. This is only possible if the current thread pointer is
not the same as the execute thread pointer AND the system state and preempt disable flags are clear. */ if (_tx_thread_system_state[core_index] == ((ULONG) 0)) {
The _tx_thread_system_state variable value is 1. So this condition is failed and higher priority thread is not moved to suspended state and keeps on running. Because the _tx_mutex_get() function return TX_SUCCESS after this condition failure.
We need proper working of mutex get function and higher priority thread should move to suspended state, if mutex is already acquired by other thread.
It is a showstopper issue for our project. Any solution to this problem is really helpful.
Thanks,
Devaraj Sivaprakasam.
The text was updated successfully, but these errors were encountered:
Description of the bug:
The mutex was acquired by lower priority thread and performing its thread activity and not yet released the mutex. When higher priority thread is trying to acquire the same mutex, still _tx_mutex_get() function call return TX_SUCCESS. So higher priority thread perform its thread activity and releasing the mutex. When mutex released from higher priority thread, _tx_mutex_put() function returned the value TX_NOT_OWNED. Because the mutex owner is lower priority thread. Due to TX_NOT_OWNED return value, our firmware is designed to generate software assertion.
Additional information:
Target - MIPS Interaptiv SMP CPU
Eclipse ThreadX version - threadx-6.4.1_rel
Compiler - GHS Multi compiler
Initially we tested our application in 50 MHz CPU clock. The application is working fine.
When we test our application in 1.1 GHz (1100 MHz) CPU clock, this issue is observed.
We debugged the issue and found the root cause.
Working scenario:
When higher priority thread try to get already acquired mutex, higher priority thread moved to suspended state and lower priority thread is continued its operation.
Non-working scenario:
When higher priority thread try to get already acquired mutex, higher priority thread is not moved to suspended state and keeps on running because of below "if" condition fail in _tx_thread_system_suspend() function.
/* Determine if preemption should take place. This is only possible if the current thread pointer is
not the same as the execute thread pointer AND the system state and preempt disable flags are clear. */
if (_tx_thread_system_state[core_index] == ((ULONG) 0))
{
The _tx_thread_system_state variable value is 1. So this condition is failed and higher priority thread is not moved to suspended state and keeps on running. Because the _tx_mutex_get() function return TX_SUCCESS after this condition failure.
We need proper working of mutex get function and higher priority thread should move to suspended state, if mutex is already acquired by other thread.
It is a showstopper issue for our project. Any solution to this problem is really helpful.
Thanks,
Devaraj Sivaprakasam.
The text was updated successfully, but these errors were encountered: