Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit SMP Locking of core data structures #1128

Open
vyzo opened this issue Feb 20, 2024 · 0 comments
Open

Revisit SMP Locking of core data structures #1128

vyzo opened this issue Feb 20, 2024 · 0 comments

Comments

@vyzo
Copy link
Collaborator

vyzo commented Feb 20, 2024

We have some core data structures in the runtime that are protected by spin locks.

The rationale for this is that they are virtually free (compared to mutexes) in UP, and workable in SMP as they tend to be fast but busy wasting power depending on contention. With low contention they are very performant, but with high contention they are power hungry.

This is an acceptable trade off for now, where SMP is still WIP, but when it's time for production we'll need a more coherent locking strategy. I would love to see some form of futex, so that we can avoid the overhead of full blown mutexes and still protect critical structures without using too much power.

@vyzo vyzo added this to the Gerbil v1.0: Najdorff milestone Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant