Skip to content

Add ts::AltMutex utility class.#7330

Closed
ywkaras wants to merge 1 commit intoapache:masterfrom
ywkaras:brief_mutex
Closed

Add ts::AltMutex utility class.#7330
ywkaras wants to merge 1 commit intoapache:masterfrom
ywkaras:brief_mutex

Conversation

@ywkaras
Copy link
Copy Markdown
Contributor

@ywkaras ywkaras commented Nov 18, 2020

No description provided.

@ywkaras ywkaras self-assigned this Nov 18, 2020
@ywkaras ywkaras added this to the 10.0.0 milestone Nov 18, 2020
@ywkaras ywkaras changed the title Add ts::BriefMutex utility class. Add ts::AltMutex utility class. Nov 18, 2020
@ywkaras ywkaras modified the milestones: 10.0.0, Sometime Jan 15, 2021
@ywkaras
Copy link
Copy Markdown
Contributor Author

ywkaras commented Feb 4, 2021

Note that this video, https://youtu.be/ZQFzMfHIxng , reports good performance using spinlocks. This class is basically a spinlock. It has yields to handle the fact the thread currently holding the mutex may get preempted. It has (micro-)sleeps to handle the possibility that the thread holding the lock gets preempted and has a lower scheduling priority than a thread waiting on the mutex. I think currently all our threads have the same priority, so the sleeps may only be for future safety.

@ywkaras
Copy link
Copy Markdown
Contributor Author

ywkaras commented Feb 4, 2021

Closing this, will reopen if we use it.

@ywkaras ywkaras closed this Feb 4, 2021
@zwoop zwoop removed this from the Sometime milestone Feb 23, 2021
@zwoop zwoop added Stale and removed Dormant labels Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants