- Fair background processing

From: [at]} <Alexander>
Date: Wed, 24 May 2006 03:29:43 +0700

----boundary-LibPST-iamunique-818041954_-_-
Content-type: text/plain

Hello, Marco!

MC> Here the changes I have made so far.
MC> As I see they are minimal. For convenience I'm attaching the entire Files.

MC> Remarks:
MC> * The ASSERT 99 in HostPorts.Rider.Input is important to detect Actions
MC> calling Input.
MC> * In TextControllers I just removed a very useless dummy call to Input.

  Very useless indeed.

  
MC> * Services actually didn't need any changes as ActionHook.Step already skips
MC> cascaded calls.

  For my use I replaced ASSERT with simple IF like here:

  IF ~Services.ActionRunning() THEN (* ASSERT was here *)
    ticks := Services.Ticks();
    Services.actionHook.Step; (* mc:060325 *)
    KERNEL32.Sleep(SHORT(MAX(20 - (Services.Ticks() - ticks), 0)));
  END;

  I did this after I discovered an Action object using Input. It was
  CpcControlTips.Action polling mouse coordinates in the background.
  I see no harm in such activity, so I just disabled the recursive
  call to Services.actionHook.Step and removed KERNEL32.Sleep which is
  unnecessary when called from an Action. So, this way Action objects
  may use Input as before, and the main application loop takes
  advantage of the patch.
  

MC> Main Problem:
MC> So far a Loop on Input would allow a tracking procedure to obtain the
MC> required user interaction without worry about the state of the system being
MC> changed.
MC> As Actions might very much change the state and typically also will change
MC> the state of views or even replace views these Tracking Functions suddenly
MC> have to face some reality like "Oh, the view I just had under the mouse
MC> pointer is suddenly a different one!"

MC> This is why I earlier said that Input should not be available at all.
MC> Instead the Tracking Messages should be handled differently.
MC> I am not 100% sure if this is possible in all cases and how big the change
MC> will be.
MC> But I guess this will be the first change I'll make to BB.

  The Main Problem you mentioned suggests that changes should be quite
  big. (I thought of it before you introduced the patch, but I am just
  not so familiar with the framework to try to fix it.) In fact, a
  tracking procedure must copy and remember all information about the
  state of the system being changed, and then verify and update that
  information after every bit of tracking event. If the state in question
  was changed from outside the tracking procedure (like from an
  Action) - a decision must be made if the tracking should be aborted.
  Maybe some sort of mouse tracker objects need to be incorporated
  into the framework? Or can it be done using available hooks?
  
---=====---
 Alexander

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy



----boundary-LibPST-iamunique-818041954_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhlbGxvLCBNYXJjbyFccGFyDQpccGFyDQpNQz4g
SGVyZSB0aGUgY2hhbmdlcyBJIGhhdmUgbWFkZSBzbyBmYXIuXHBhcg0KTUM+IEFzIEkgc2VlIHRo
ZXkgYXJlIG1pbmltYWwuIEZvciBjb252ZW5pZW5jZSBJJ20gYXR0YWNoaW5nIHRoZSBlbnRpcmUg
RmlsZXMuXHBhcg0KXHBhcg0KTUM+IFJlbWFya3M6XHBhcg0KTUM+ICogVGhlIEFTU0VSVCA5OSBp
biBIb3N0UG9ydHMuUmlkZXIuSW5wdXQgaXMgaW1wb3J0YW50IHRvIGRldGVjdCBBY3Rpb25zXHBh
cg0KTUM+IGNhbGxpbmcgSW5wdXQuXHBhcg0KTUM+ICogSW4gVGV4dENvbnRyb2xsZXJzIEkganVz
dCByZW1vdmVkIGEgdmVyeSB1c2VsZXNzIGR1bW15IGNhbGwgdG8gSW5wdXQuXHBhcg0KXHBhcg0K
ICBWZXJ5IHVzZWxlc3MgaW5kZWVkLlxwYXINClxwYXINCiAgXHBhcg0KTUM+ICogU2VydmljZXMg
YWN0dWFs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VjdHMgbmVlZCB0byBiZSBpbmNvcnBvcmF0
ZWRccGFyDQogIGludG8gdGhlIGZyYW1ld29yaz8gT3IgY2FuIGl0IGJlIGRvbmUgdXNpbmcgYXZh
aWxhYmxlIGhvb2tzP1xwYXINCiAgXHBhcg0KLS0tPT09PT0tLS1ccGFyDQogQWxleGFuZGVyXHBh
cg0KXHBhcg0KLS0tIEJsYWNrQm94XHBhcg0KLS0tIHNlbmQgc3ViamVjdCBIRUxQIG9yIFVOU1VC
U0NSSUJFIHRvIGJsYWNrYm94QG9iZXJvbi5jaFxwYXINClxwYXINCn0=


----boundary-LibPST-iamunique-818041954_-_---
Received on Tue May 23 2006 - 22:29:43 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:58 UTC