Re: [g-a-devel] registering/deregistering event listeners



Sam

2008/12/12 Quiring, Sam <Sam Quiring windriver com>:
> Thanks for your reply, although I have to admit I find it troubling.
> Yes, I am deregistering in the event handler.  It did not occur to me
> that I should limit what I do in the event handlers.

It's a question of timing and reentrancy; you may hit untested paths.
It's rather like the old days of writing interrupt handlers in dos or
embedded apps. For example I logged using print statements directly in
the handlers and got weird non-deterministic behaviour which threw me
for ages.

> Were you able to build a reliable application using an asynch approach?
> Are you programming in C, Python, or some other language?

I use Python by choice these days though have years of C. Python is
becomming the API of choice for ATI-SPI. You can now set a flag in the
Python API to get async delivery. My program is Jambu
http://jambu.fullmeasure.co.uk, though needs some TLC now. The code
works reliable, though finding exactly which events get fired when can
be 'fun'  as it is not tightly defined.

You can also look at the code for Accerciser and Orca, and certainly
will want to use accerciser.
You may find this useful
http://live.gnome.org/Accessibility/PythonPoweredAccessibility

Steve

> -Sam
>
> -----Original Message-----
> From: Steve Lee [mailto:steve fullmeasure co uk]
> Sent: Friday, December 12, 2008 10:48 AM
> To: Quiring, Sam
> Cc: gnome-accessibility-devel gnome org
> Subject: Re: [g-a-devel] registering/deregistering event listeners
>
> 2008/12/12 Quiring, Sam <Sam Quiring windriver com>:
>>     1. register the event handlers
>>     2. wait for the user to do his thing
>>     3. deregister the event handlers
>>
>> After a few executions of this function (3..6), it dies during step 1:
>> registering the event handlers.  In fact the entire GNOME desktop
>> locks up and I'm forced to power cycle the machine to get control
>> back.  (Is there an easier/cleaner way to restart GNOME?).
>
> Are you deregistering in the event handler?
>
> I found that it best to do absolute minimum in the handers and call very
> few functions. In the end I just put events in my own queue and dequeue
> in idle processing - in other words make processing asynch.
>
> I don't know what the official position is.
>
> Steve Lee
>


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