Skip to content

Add an event based on futex#311

Merged
ehpor merged 12 commits intodevelopfrom
feature/futex_event
May 30, 2025
Merged

Add an event based on futex#311
ehpor merged 12 commits intodevelopfrom
feature/futex_event

Conversation

@ehpor
Copy link
Copy Markdown
Collaborator

@ehpor ehpor commented May 2, 2025

Caution

This PR requires #310 to be merged before.

Linux only. There might be a way to do MacOS too, but I remember there being issues with it not having a timeout. There is no way to do this type of synchronization accross processes in Windows, since it only supports intra-process futex.

This PR also adds a test for all (implemented) events, rather than just the default implementation.

Results on AMD Threadripper 5995WX (64 cores). This is the fastest (non-spinlock) synchronization primitive that is implemented on Linux by a full microsecond.
image

@ehpor ehpor added the enhancement New feature or request label May 2, 2025
@ehpor ehpor self-assigned this May 2, 2025
@ehpor
Copy link
Copy Markdown
Collaborator Author

ehpor commented May 7, 2025

Tests are deadlocking due to #310 not being merged yet. I'll wait for that one before merging this.

@ehpor ehpor force-pushed the feature/futex_event branch from 89b395c to 2fe7c6d Compare May 7, 2025 22:12
@ehpor ehpor requested a review from raphaelpclt May 8, 2025 20:08
@ehpor ehpor force-pushed the feature/futex_event branch from 2fe7c6d to 07ecb8b Compare May 17, 2025 06:05
@ehpor ehpor marked this pull request as ready for review May 17, 2025 06:07
@ehpor
Copy link
Copy Markdown
Collaborator Author

ehpor commented May 17, 2025

Ready for review but see the caution in the first post.

@ehpor ehpor added the bugfix Fixing of a bug label May 17, 2025
@ehpor
Copy link
Copy Markdown
Collaborator Author

ehpor commented May 17, 2025

Nope, the deadlock is still there. I'll have to check this again on Linux.

@ehpor ehpor marked this pull request as draft May 17, 2025 06:20
@ehpor
Copy link
Copy Markdown
Collaborator Author

ehpor commented May 18, 2025

Regrettably, my inner goldfish prevailed and I forgot to actually implement timeouts for the futex event. That's why it was deadlocking. Now fixed.

@ehpor ehpor marked this pull request as ready for review May 18, 2025 04:19
@ehpor ehpor force-pushed the feature/futex_event branch from 32b0e67 to 4c5b598 Compare May 30, 2025 18:59
@ehpor
Copy link
Copy Markdown
Collaborator Author

ehpor commented May 30, 2025

Rebased after #310 was merged.

Copy link
Copy Markdown
Contributor

@steigersg steigersg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this benchmark on the hicattrois linux machine without issue so seems good

Screenshot 2025-05-30 at 4 23 36 PM

@ehpor
Copy link
Copy Markdown
Collaborator Author

ehpor commented May 30, 2025

@steigersg For reference: what processor? And what Linux version?

@ehpor ehpor merged commit ecc96f3 into develop May 30, 2025
6 checks passed
@ehpor ehpor deleted the feature/futex_event branch May 30, 2025 20:30
@steigersg
Copy link
Copy Markdown
Contributor

@steigersg For reference: what processor? And what Linux version?

Intel Xeon Gold 6242R x 80 Processor and Ubuntu 24.04.2 LTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixing of a bug enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants