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

Robin Gareus robin at gareus.org
Sun Dec 15 08:43:29 PST 2013


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.

best,
robin



More information about the Devel mailing list