From d0f0373228199fb792b9828abee8f04995858a9a Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 30 Sep 2024 03:09:28 -0400 Subject: [PATCH] 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 --- include/clap/host.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/clap/host.h b/include/clap/host.h index ddfeb8e7..c647c198 100644 --- a/include/clap/host.h +++ b/include/clap/host.h @@ -35,6 +35,12 @@ 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 withink 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;