[LV2] Is suil_instance_port_event thread-safe? Is lilv atomic-safe when handling changing control port values?

Yuri yuri at rawbw.com
Thu Sep 14 13:33:12 PDT 2017

On 09/14/17 13:11, Robin Gareus wrote:
> Fromhttp://lv2plug.in/ns/extensions/ui/ui.html
> "UIs written to this specification do not need to be thread-safe. All
> functions may only be called in the "UI thread". There is only one UI
> thread (for toolkits, the one the UI main loop runs in)."
> ergo: The host must call all UI functions in a single thread.

IMO, it's worth mentioning in its man page that suil_instance_port_event 
isn't thread-safe, because it is very easy to call it from other threads.

>> Another, related issue is between plugin, running in a separate thread,
>> and control values changed by the app. Control values are floating point
>> numbers, shared between the app and a plugin using
>> lilv_instance_connect_port.
> A plugin cannot modify its own inputs, so atomicity is not needed. It's
> always the host that writes values and the values must not change while
> a plugin's run() is called.
> A common implementation technique is for the host to double-buffer the
> control-parameters and set them before calling lilv_instance_run().

This clarifies it, thanks!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lv2plug.in/pipermail/devel-lv2plug.in/attachments/20170914/00c273f5/attachment.html>

More information about the Devel mailing list