realbasic-plugins
[Top] [All Lists]

Re: Callbacks from dylibs

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: Callbacks from dylibs
From: Norman Palardy <npalardy at great-white-software dot com>
Date: Sat, 4 Nov 2006 09:28:47 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <7 dot 0 dot 1 dot 0 dot 2 dot 20061104003456 dot 1645fae0 at chickensys dot com> <8B2828D2-244D-43B9-B3FA-3E28E6C92B9F at great-white-software dot com> <243543E0-615A-4B3B-893E-E43CE7E12985 at mac dot com> <177117F0-DBA0-47D5-B7DD-C5813C660257 at great-white-software dot com> <CB6E332F-E530-440C-BC4E-98F86EC2ED3F at mac dot com>

On Nov 04, 2006, at 9:20 AM, Alfred Van Hoek wrote:


On Nov 4, 2006, at 10:22 AM, Norman Palardy wrote:

It probably needs to yield to RB which I why I'd do a plugin


Given that I just have read the nug digest version, where the same problem is discussed, I will repost what I had said previously and a general solution to the problem:

If you are being called by a callback the natural instinct is to respond immediately. And if it requires updating of a GUI, refreshing windows, or a lengthy calculation, then it will interfere with REALbasic's runtime. Basically, you are blocking the event loop if you are going to issue a lot of stuff, while in the callback. So you do not want to do this.

Very nice stuff.
I have one question though.
Suppose the dylib is processing a huge amount of data and calling back to RB to try and update the UI. Isn't there still going to be an issue with the dylib not yielding to RB and so the UI updates would still not occur ?

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>