lib_locks swlock on XS2

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
User avatar
akp
Respected Member
Posts: 323
Joined: Thu Nov 26, 2015 11:47 pm

lib_locks swlock on XS2

Postby akp » Mon Nov 11, 2019 1:18 am

Hi guys,

I've been doing a little experimentation with lib_locks swlock on XS2. The implementation is not fair when high priority cores contend with low priority cores for the lock i.e. in swlock_acquire(). The low priority cores get the lock more often than the high priority cores for some reason. Of course I don't expect it to be as good as hwlock but it should be pretty reasonably comparable. I am testing a fix that does following:
- Saves core prio
- Sets core prio low
- Obtains lock through executing XS2A optimized version of swlock_try_acquire
--> dual issue to improve speed
--> remove excess nops since core is known to be low priority
- Restores core priority before returning

Who is online

Users browsing this forum: No registered users and 11 guests