[g-a-devel]Sync SR Queue with ATSPI



Hi Bill,

We have introduced an async queue in SR core (from glib) in order be able to
accept multiple input on different threads (ATSPI, Braille, Speech, etc). So
we get/process the events on the same thread. Eventually we have something
like this:

// initialize sub components
InitBraille(...);
InitSpeech(...);
InitSRL(...);
// ....

// enter main loop
while (TRUE)
{
    // get event from queue
     g_queue_pop (...);

    // process event
    // ...
} ;

We were facing the following design issue: sometimes before we enter the
while loop we have to call SPI_Event_main in order to receive ATSPI events.
The problem is, this function blocks (doesn't return).

1) The first ideea was to call this function from another thread. We
expected that in this case the ATSPI will call us back on that thread. Now
that we have the async queue, this is not a problem for us any more but we
suspect it might be for ATSPI as we might call its functions from another
thread (our main thread, where we read the queue).

2) A second idea was to ask you to add a periodic callback to ATSPI in which
we read/process our event queue, instead of having a main loop. We assumed
that ATSPI will call us back in the correct thread so that we can make
further ATSPI calls from it.

3) Remus suggested a third possibility, as a variant of 2) through the
function g_timeout_add which seems to get us out of SPI_Event_main by
calling our callback on the ATSPI thread. This seems to work OK for our
purposes, but we don't know if this approach is recomended and what other
implication or side effects it might have on ATSPI.

Please tell us what you think about it.

Draghi





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]