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

Grouped events #362

Open
olofson opened this issue Nov 24, 2022 · 1 comment
Open

Grouped events #362

olofson opened this issue Nov 24, 2022 · 1 comment
Labels
enhancement Minor features, and improvements on existing functionality feature Entirely new features multitdreading Issues related to distributing work across CPU threads

Comments

@olofson
Copy link
Owner

olofson commented Nov 24, 2022

Inspired by a gamedev problem I'm currently working on, I realize that it would be useful to declare events as related, so they can be managed in a way similar to database transactions. More specifically;

  • Late events can be handled on a group bases, in a configurable manner:
    • Handle late events ASAP, disregarding groups (current behavior)
    • Delay the whole group, preserving relative timing
    • Cancel the whole group
  • If we implement cancel, update, repeat or similar operations on pending events, we can have those operations apply to whole groups, database transaction style, guaranteeing that an operation will either be performed in full on all events in the group, or the whole operation is cancelled or unrolled.

Since interface contexts can be considered stateful (current interfaces are created per thread, and a thread-safe implementation would rely on TLS, to the same effect), we can implement groups by adding methods along the lines of BeginGroup()/EndGroup(), where BeginGroup() switches event enqueuing to a local buffer, and EndGroup() finalizes and sends the group via a single event to the engine context. Thus, API can remain simple to use, with virtually no impact on synchronization, performance etc when using event grouping.

@olofson olofson added enhancement Minor features, and improvements on existing functionality feature Entirely new features multitdreading Issues related to distributing work across CPU threads labels Nov 24, 2022
@clort81
Copy link

clort81 commented Nov 10, 2023

This is really a great sounding software synthesizer for use in games. Your demos were great too. I'd use it if i could be as productive with my own projects It's much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Minor features, and improvements on existing functionality feature Entirely new features multitdreading Issues related to distributing work across CPU threads
Projects
None yet
Development

No branches or pull requests

2 participants