[LV2] worker thread question

David Robillard d at drobilla.net
Sun Dec 30 07:46:21 PST 2012


On Sun, 2012-12-30 at 07:49 +0100, hermann meyer wrote:
[...]
> > Could you explain me why? I call a thread from a other thread, so 
> > under which circumstances it mater from which thread I call it? If I 
> > get what you mean here, I could truly move this call to run, just 
> > using a sem_post. But it seems to me foolish to do so.
> >
> Ah,:-[ okay, I get this point and will move the schedule call to run.

If you want to schedule work from run(), then use the worker.  That is
what it is for.

If you want to do work from some other non-realtime thread like you are
here, then simply don't use the worker.  It does nothing for you in that
situation, so there is no point.  Just do the work immediately in the
calling thread.

That said, in your case, run() + worker is the best solution.

-dr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lv2plug.in/pipermail/devel-lv2plug.in/attachments/20121230/a842b6dd/attachment-0002.pgp>


More information about the Devel mailing list