[LV2] [PATCH 1/5] add eg05-scope example plugin

David Robillard d at drobilla.net
Sun Dec 15 10:06:53 PST 2013

On Sun, 2013-12-15 at 17:43 +0100, Robin Gareus wrote:
> On 12/15/2013 07:33 AM, David Robillard wrote:
> > On Mon, 2013-12-09 at 20:41 +0100, Robin Gareus wrote:
> > [...]
> >>  plugins/eg05-scope.lv2/examploscope_ui.c   |  629 ++++++++++++++++++++++++++++
> > [...]
> > 
> > This UI has a bunch of locking in it, and strange comments about
> > threads.  In what scenario are you seeing the UI methods called from
> > multiple threads concurrently?
> If the host only calls port_event() from the same thread as UI expose
> (e.g. gtk-idle), the locks will never be used.
> But when port_event() is called while the UI is rendering, the locks (or
> an alternative lockfree ringbuffer) is needed. This can happen in the
> following situations:
> - the example is turned into a non-gtk plugin (e.g OSX Cocoa, openGL,..)
> - If the host creates a custom thread to deliver port_events (e.g a QT host)
> The locks can go away if the plugin is indented to only serve as very
> simple example to be run in jalv.gtk. However, it is trivial to re-use
> the demonstrated cairo-rendering in a variety of other contexts where
> concurrency matters.

But the host is not allowed to do this.  It violates the spec.  UIs are
explicitly NOT required to deal with concurrent calls to methods, i.e.
hosts are explicitly NOT allowed to do this.

Are there really any scenarios where it would actually be useful to do
so anyway?  Useful enough to offset the severe complexity issues?


More information about the Devel mailing list