(unknown charset) - Paralleling computing with Blackbox and Component Pascal

From: (unknown charset) [at]} <Alexander>
Date: Wed, 29 Mar 2006 00:21:23 +0700

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

Hello, Virgilio!

VGR> I was wondering whether it could be possible to use blackbox
VGR> applications on a cluster of computers. Is there any implementation
VGR> of, for examples, threads for Blackbox? Could it be possible to link
VGR> Blackbox applications to any C/C++ code to do the trick?

  If you work under Windows...

  The BlackBox is single-threaded. It only supports cooperative
  multitastking when each of parallel processes must deliberately
  postpone next step of it's execution (using Services.DoLater).
  Any tight loop hangs entire BlackBox application.
  Any erroneour communitation through windows sockets (like when you
  try to connect to some server with network cable unplugged) also
  hangs entire BlackBox application until socket returns error code.
  Any infinite loop with badly implemented exit conditions hangs
  entire BlackBox application (Ctrl+Break doesn't help if it never
  comes to check the windows message queue).

  I mentioned cooperative multitasking. You may implement
  Services.Action. Basically there's just a windows timer, which posts
  a WM_TIMER to the BlackBox application message queue. When the
  message arrives BlackBox checks if there are any Services.Action
  descendants registered with delay time expired. If there are, it
  calls their Do method where they may perform next step of their job
  and postpone themselves again.
  So, if BlackBox doesn't check message queue for some time (like when
  some task has a very important and hard work to do right now),
  all other parallel tasks just sit and wait.

  I already complained in this mailing list about poor implementation
  of some loops in system modules of BlackBox, but heard nothing in
  response. Here's the thing: open a performance monitor to see CPU
  activity, select some text in BlackBox, then press and hold left
  mouse button on the text (don't move the mouse). Until you release
  the button CPU usage will be 100%, because BlackBox just waits in a
  tight loop when you release the button or start a drag-and-drop
  operation.
  And while he waits it doesn't check the message queue, and no
  parallel tasks will be executed.
  There are several places with this kind of code. For exaple, try the
  same thing with resizing controls on a form.

  The good news is that it is possible to use DLLs with any ?/?++
  code. So you could write your own thread that would perform some
  tasks in the background. You could pass data to and from it or check
  whether it has finished its job repeatedly with a Services.Action
  object.
  In this way, as you can understand, the thread code in DLL cannot be
  written in Oberon. It would be some C/Delphi/Assembler code.

  Another option (requires quite advanced knowledge if you ask me) is
  to run several instances of BlackBox and control their execution
  through OLE automation facilities. COM/OLE is quite supported in
  BlackBox, but I'm not an expert in this area (only yesterday my
  first test COM project begun working).

  As to the problems with mouse handling loops and bad cooperation of
  BlackBox himself - these can be solved since source code for system
  libraries is available. (In fact, I did solve them.)
  
---===---
 Alexander

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



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

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTFcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDIwNCBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xm
MlxmbmlsXGZjaGFyc2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVy
IE5ldzt9fQ0Ke1xjb2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1
NTt9DQpcdWMxXHBhcmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhlbGxvLCBWaXJnaWxpbyFc
cGFyDQpccGFyDQpWR1I+IEkgd2FzIHdvbmRlcmluZyB3aGV0aGVyIGl0IGNvdWxkIGJlIHBvc3Np
YmxlIHRvIHVzZSBibGFja2JveFxwYXINClZHUj4gYXBwbGljYXRpb25zIG9uIGEgY2x1c3RlciBv
ZiBjb21wdXRlcnMuIElzIHRoZXJlIGFueSBpbXBsZW1lbnRhdGlvblxwYXINClZHUj4gb2YsIGZv
ciBleGFtcGxlcywgdGhyZWFkcyBmb3IgQmxhY2tib3g/IENvdWxkIGl0IGJlIHBvc3NpYmxlIHRv
IGxpbmtccGFyDQpWR1I+IEJsYWNrYm94IGFwcGxpY2F0aW9ucyB0byBhbnkgQy9DKysgY29kZSB0
byBkbyB0aGU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XZhaWxhYmxlLiAoSW4gZmFjdCwgSSBk
aWQgc29sdmUgdGhlbS4pIFxwYXINCiAgXHBhcg0KLS0tPT09PT0tLS1ccGFyDQogQWxleGFuZGVy
XHBhcg0KXHBhcg0KLS0tIEJsYWNrQm94XHBhcg0KLS0tIHNlbmQgc3ViamVjdCBIRUxQIG9yIFVO
U1VCU0NSSUJFIHRvIGJsYWNrYm94QG9iZXJvbi5jaH19AApWR1I+IGFwcGw

----boundary-LibPST-iamunique-1432859435_-_---
Received on Tue Mar 28 2006 - 18:21:23 UTC

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