Context switch

Discussions and support about ChibiOS/RT, the free embedded RTOS.
Prathibha Prakash
Posts: 10
Joined: Sat Jun 22, 2019 6:15 pm

Re: Context switch

Postby Prathibha Prakash » Wed Sep 04, 2019 6:28 pm

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.

User avatar
Giovanni
Site Admin
Posts: 12098
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 549 times
Been thanked: 469 times
Contact:

Re: Context switch

Postby Giovanni » Wed Sep 04, 2019 6:32 pm

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


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 1 guest