Re: [BLACKBOX] Long running command and Dialog.ShowStatus

From: [at]} <Josef>
Date: Fri, 4 Dec 2009 11:53:51 +0100

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

Robert wrote:
> Is it that that my programs are not modern and
> well-written, or is it that BlackBox is not?

BB is single threaded and in case of long running commands
this needs special support for interruption, screen update etc.

In BB, it would not be possible to use a second thread for
long running commands, because the BB runtime system
and library depend on the single threaded model.
The memory management and GC, for example, would
have to be significantly more complex if multi threading
is supported and the same holds for all the library modules.

The C or C++ runtime systems, in particular malloc/free,
typically support multi-threading. There is a host of
different implementations that are even optimized for
heavy multi threading and that use per thread caches
in order to avoid contention (see for example
'Google Performance Tools', which contains TCMalloc).
Most other things need to be synchronized manually,
which is a potential source of race conditions that occasionally
result in severe system crashes.

So, I believe, it is still a reasonable choice to stick with the
single-threaded model, but it would be nice if BB provides
something like 'ProcessMessages' in an API-procedure.
Such an API would need to be flexible enough
to support different use cases, in particular blocking user input
or allowing it.
Then we would not have to code it in our applications and would
follow Microsoft's advice.

It is a completely different topic to interrupt a buggy endless loop
by e.g. Ctrl-C or similar key combination. This is not a long running
command that may be terminated gracefully at well defined points
but an error situation. I am not expert enough in Windows
programming to say if it is technically possible or not, but I
guesss it is.
In Unix it could be solved by sending a special signal to the
process that executes the endless loop.

- Josef


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-966882980_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0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