Re: [LAD] alsa sequencer and sysex editing

From: <rdxesy@email-addr-hidden>
Date: Mon Jun 02 2008 - 20:32:16 EEST

On Mon, Jun 02, 2008 at 18:33:08 +0200
Fons Adriaensen <fons@email-addr-hidden> wrote:
> On Mon, Jun 02, 2008 at 06:13:26PM +0200, rdxesy@email-addr-hidden wrote:
>
> > My question is: how would I make sure to catch all answers
> > from the device without using a thread and without just
> > waiting for an constant time before I check if there is an
> > answer( which is alo not very fail save, a message might
> > take a little longer if there is traffic on the midibus)?
>
> There seem to be two ways: either you make the read blocking
> (which will prevent you from doing anything until a reply
> arrives), or use a separate thread to read (again blocking).
>
> For apps handling async events using threads is really the
> 'natural' thing to do. If multithreading is new to you, now
> is the time to jump into it !

Ciao,

thank you for that info. The problem with that thread
approach is that i cannot call gtk_* stuff from it (which
is needed, as most answers are values that will be used to
set sliders, comboboxes and spinbuttons).
I could use g_idle_add or g_timeout_add for that thread but
that adds another async layer, and questions like "what
would be the timeout"?
Is there a way to call a function in the main loop from a
thread "now and once" (i mean, without using
g_idle/timeout_add, something thats just like a call to a
"normal" function but calls it in the main loop)?

Thank you.

Jan
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Tue Jun 3 00:15:06 2008

This archive was generated by hypermail 2.1.8 : Tue Jun 03 2008 - 00:15:06 EEST