pyamsoft / tetherfi

TetherFi - Internet sharing without Root
Apache License 2.0
391 stars 29 forks source link

Sweep and remove mutexes where possible #336

Closed pyamsoft closed 5 days ago

pyamsoft commented 6 days 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 5 days 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.