- A Cookbook Topic: "Delay", "WaitUntil" and "Let'sseeactions"

From: [at]} <Jürgen>
Date: Fri, 12 May 2006 21:58:22 +0200

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

Marco Ciot schrieb:

>O.k.
>If you look at it that way, yes, then the system will be blocked against
>user interaction.
>BUT: the background processing will be done, i.e. all registered actions
>will execute their Do method as requested by them through Services.DoLater.
>
>According to me it doesn't matter that the system freezes during such a call
>to Wait.Time.
>
>To be honest such a function to me appears to be the most contradicting one
>with respect to multi tasking.
>As I understood, Helmut wanted to use it to easily port old Oberon software.
>
>Just think of the fact that ONLY one task of all tasks in a multitasking
>system will ever be able to execute Wait.Time, and this task will always be
>the interactive task in BB.
>All other tasks, i.e. the background tasks will simply use the DoLater
>function, which does nothing else but wait the desired time.
>
>NOW, if anybody wanted to have such a Wait.Time function to be useful for
>background tasks, then he had to really implement threads instead of actions
>in BB.
>Note that a thread always needs to have its separated program stack.
>In other words, that would be a bigger thing and I believe it contradicts
>the philosophy of cooperating multitasking.
>
>I'm convinced that everything can be implemented using actions and the
>result code will even be more efficient, more readable AND especially more
>ROBUST within a framework like the one of BB.
>
>Marco Ciot
>
>
>-----Original Message-----
>From: blackbox{([at]})nowhere.xy
>G. Danforth
>Sent: Friday, May 12, 2006 19:52
>To: BlackBox Mailing List
>Subject: [BlackBox] - A Cookbook Topic: "Delay", "WaitUntil" and
>"Let'ssee actions"
>
>
>Marco,
>If the following is what you meant then it doesn't work for me. The
>cursor remains as the pointing hand
>when the commandor is clicked and no actions can be initiated during the
>wait time. So what did you
>really mean?
>-Doug
>-----------------
>MODULE Wait;
> IMPORT Services, Out:=StdLog;
>
> PROCEDURE Time (ms: INTEGER);
> VAR time: LONGINT;
> BEGIN
> time := Services.Ticks() + ms;
> WHILE Services.Ticks() < time DO
> Services.actionHook.Step
> END
> END Time;
>
> PROCEDURE Test*;
> BEGIN
> Out.String("start..");
> Time(10000);
> Out.String("stop.");
> Out.Ln;
> END Test;
>
>END Wait.
>
>--------------------
>Marco Ciot wrote:
>
>
>>Hello Helmut
>>
>>Sorry for not contributing earlier to this subject.
>>I quickly read the follow ups and didn't really see a reason why to do

>>
>>
>such
>
>
>>fuzzy things... sorry folks :)
>>
>>The solution to this indeed is to call Services.actionHook.Step during a
>>timed loop.
>>This procedure exactly does the stepping of the background tasks
>>(Services.Actions) and works fine while being called on command level

>>
>>
>also.
>
>
>>(It should not be called by Actions, however!)
>>(Well, let me also clarify that this is my understanding of the module
>>Services and not a documented feature.)
>>
>>How come you didn't try this yourself after having suggested it in

>>
>>
>xyBoss3?
>
>
>>Note that by adding such a call in HostPorts.Input followed by a

>>
>>
>conditional
>
>
>>Kernel.Sleep and having Services.actionHook.Step a little bit more robust

>>towards calls from anywhere (even Actions) any BB system becomes much more
>>responsive and won't do any excess CPU heating while tracking the mouse,
>>e.g. making a text selection ;)
>>
>>Regards
>>Marco Ciot
>>
>>
>>
>>
>
>--- BlackBox
>--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
>
>--- BlackBox
>--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
>
>
>
Hey All,
shouldn't we install a BlackboxWiki?

Cheers
Jürgen

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



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

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWU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ZSBiaXQg
bW9yZSByb2J1c3RccGFyDQo+PnRvd2FyZHMgY2FsbHMgZnJvbSBhbnl3aGVyZSAoZXZlbiBBY3Rp
b25zKSBhbnkgQkIgc3lzdGVtIGJlY29tZXMgbXVjaCBtb3JlXHBhcg0KPj5yZXNwb25zaXZlIGFu
ZCB3b24ndCBkbyBhbnkgZXhjZXNzIENQVSBoZWF0aW5nIHdoaWxlIHRyYWNraW5nIHRoZSBtb3Vz
ZSxccGFyDQo+PmUuZy4gbWFraW5nIGEgdGV4dCBzZWxlY3Rpb24gOylccGFyDQo+PlxwYXINCj4+
UmVnYXJkc1xwYXINCj4+TWFyY28gQ2lvdFxwYXINCj4+XHBhcg0KPj5ccGFyDQo+PiAgICBccGFy
DQo+PlxwYXINCj5ccGFyDQo+LS0tIEJsYWNrQm94XHBhcg0KPi0tLSBzZW5kIHN1YmplY3QgSEVM
UCBvciBVTlNVQlNDUklCRSB0byBibGFja2JveEBvYmVyb24uY2hccGFyDQo+XHBhcg0KPi0tLSBC
bGFja0JveFxwYXINCj4tLS0gc2VuZCBzdWJqZWN0IEhFTFAgb3IgVU5TVUJTQ1JJQkUgdG8gYmxh
Y2tib3hAb2Jlcm9uLmNoXHBhcg0KPlxwYXINCj4gIFxwYXINCj5ccGFyDQpIZXkgQWxsLFxwYXIN
CnNob3VsZG4ndCB3ZSBpbnN0YWxsIGEgQmxhY2tib3hXaWtpP1xwYXINClxwYXINCkNoZWVyc1xw
YXINCkpcJ2ZjcmdlblxwYXINClxwYXINCi0tLSBCbGFja0JveFxwYXINCi0tLSBzZW5kIHN1Ympl
Y3QgSEVMUCBvciBVTlNVQlNDUklCRSB0byBibGFja2JveEBvYmVyb24uY2hccGFyDQpccGFyDQp9



----boundary-LibPST-iamunique-1059749906_-_---
Received on Fri May 12 2006 - 21:58:22 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:01 UTC