commit e898b782b98ff2c476c91e3fae97178dbf26bfd4
parent 27f20f81dec40b930d79ef429fd35dcc2d45db5b
Author: Paul <baconpaul@users.noreply.github.com>
Date: Mon, 30 Sep 2024 03:09:01 -0400
Add a description of the expectation of request_callback timing (#422)
* Add a description of the expectation of request_callback timing
Without making a requirement, indicate the intent of the timing.
* Add an apostrophe
* Add host can starve feedback from alex
* more review feedback
* notjusthosts
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/include/clap/host.h b/include/clap/host.h
@@ -35,6 +35,13 @@ typedef struct clap_host {
void(CLAP_ABI *request_process)(const struct clap_host *host);
// Request the host to schedule a call to plugin->on_main_thread(plugin) on the main thread.
+ // This callback should be called as soon as practicable, usually in the host application's next
+ // available main thread time slice. Typically callbacks occur within 33ms / 30hz.
+ // Despite this guidance, plugins should not make assumptions about the exactness of timing for
+ // a main thread callback, but hosts should endeavour to be prompt. For example, in high load
+ // situations the environment may starve the gui/main thread in favor of audio processing,
+ // leading to substantially longer latencies for the callback than the indicative times given
+ // here.
// [thread-safe]
void(CLAP_ABI *request_callback)(const struct clap_host *host);
} clap_host_t;