You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 12, 2024. It is now read-only.
Hello! I recently decided to integrate sx into a project to use it for threading / job allocation.
When converting from the largely Win32-esque threading API (the project is a fork of id Tech 4), it seemed like sx_signal worked differently than I'd expected, so I wanted to start a ticket with some of the issues I encountered & if my local fork might be a good fit. mbullington@d881665
Largely I made it mirror Win32 Events more closely, in that it's a switch that gets "flipped" on and waits for listeners.
If there are already listeners we do a pthread_cond_broadcast & reset, otherwise we store the value for the next waiter.
Separate from these changes (but included in the Win32 API) I added a manual_reset, where the signal won't unflip upon a waiter, but instead needs to manually be reset with the sx_signal_reset_if_manual method.
Funny enough I actually removed the old Win32 API from this implementation, as it looks like there was compile-time branching that only ran it for Windows XP (< 6) and older. I figured by now we'd be onto Vista 😆 , and this is the only place in the codebase that had this branching.
If this isn't too opinionated—or you happen to agree—happy to open a PR. Thanks! 😄
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello! I recently decided to integrate
sx
into a project to use it for threading / job allocation.When converting from the largely Win32-esque threading API (the project is a fork of id Tech 4), it seemed like
sx_signal
worked differently than I'd expected, so I wanted to start a ticket with some of the issues I encountered & if my local fork might be a good fit. mbullington@d881665Largely I made it mirror Win32 Events more closely, in that it's a switch that gets "flipped" on and waits for listeners.
pthread_cond_broadcast
& reset, otherwise we store the value for the next waiter.manual_reset
, where the signal won't unflip upon a waiter, but instead needs to manually be reset with thesx_signal_reset_if_manual
method.If this isn't too opinionated—or you happen to agree—happy to open a PR. Thanks! 😄
The text was updated successfully, but these errors were encountered: