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

Add Worker system for asynchronous processing #1700

Open
kunstmusik opened this issue Mar 22, 2023 · 2 comments
Open

Add Worker system for asynchronous processing #1700

kunstmusik opened this issue Mar 22, 2023 · 2 comments
Labels
Milestone

Comments

@kunstmusik
Copy link
Member

Summary

Add a worker system similar to JS Web Workers. System would run in its own thread and have its own context (i.e., CSOUND* instance) and have a defined API for message passing between the the main CSOUND thread and the worker thread.

Goals

  • Allow for long-running tasks to be run in a separate thread, such as large sample loading, sample generation, sample processing, signal analysis, network requests, etc.
  • Add to Csound API functions to deal with transferring data between contexts (e.g., how to load an ftable in one CSOUND and transfer it to another safely)
@vlazzarini
Copy link
Member

I think it is a good idea, but we may need to integrate it with the hard realtime operation we already have in place. This seems to work reasonably well in hard realtime systems like Bela (allowing Csound to run there, if it weren't for it, we could not do it).

Also since we're rethinking the whole API design, it is a good time to consider proposals like this one.

@kunstmusik
Copy link
Member Author

It's a good point that we will need to figure out how this interacts with hard realtime and other platform considerations. I think we could experiment on desktop first and disable on other platforms, then slowly add to various platforms.

I also had the thought that we might not even need this to be a Csound7 internal system and we might be able to get away with making this a family of opcodes (i.e., there may be enough already in CS7 to support building this). Will need to experiment and confirm.

@kunstmusik kunstmusik added this to the 7.x milestone Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants