Page 2 of 2

Re: Context switch

Posted: Wed Sep 04, 2019 6:28 pm
by Prathibha Prakash
Hi,

As per the reference viewtopic.php?t=1870#p15421

"The low priority thread would perform its unlock because preempted threads are always in the ISR epilogue code that does exactly that"

How is it possible for the low priority thread to perform unlock after context switch,please can you explain this in detail.

I can't found out any documentation for this.

Re: Context switch

Posted: Wed Sep 04, 2019 6:32 pm
by Giovanni
It is very simple, during a context switch this is what happens:

1) lock
2) switch
3) unlock

The lock is performed by the thread being switched out, the unlock is performed by the thread being switched in.

Giovanni