pyamsoft / tetherfi

TetherFi - Internet sharing without Root
Apache License 2.0
428 stars 36 forks source link

Sweep and remove mutexes where possible #336

Closed pyamsoft closed 2 months ago

pyamsoft commented 2 months ago

Mutexes are in theory twice as expensive as an atomic coroutine's operation, as a mutex itself must internally apply an atomic operation to lock and another to unlock.

We should be able to kill mutex via a MSF update method, and for situations where we don't need observability, a lighter class could be implemented.

pyamsoft commented 2 months ago

Actually, since a mutex is not synchronized, it is also implemented with purely wait loop atomics, so theres no real benefit to changing code.