Re: Multithreading

From: [at]} <Werner>
Date: Thu, 20 Feb 2003 08:47:34 +0100

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

There is another way to provide "Multi-Tasking" with
BlackBox.

BlackBox.exe accepts Command-Line Parameters.
Open a Shell, CD to the BlackBox Direcotry and enter:
> BlackBox.exe /par "my paramter list"
Within the called BlackBox you can view the
paramter in the variable Dialog.commandLinePars

You can start any Command using
HostDialog.Start

So how to implement this

Master-Process
======
Call Slave-Process HostDialog.Start('BlackBox /par "my parameters or param-file" ')
Use a Service.Action for polling if the file "Slave-running.empty" still exists.
After the file is gone read in the data out of the param-file or any other data-file.

Slave-Process
======
Modify module Config to check if some paramters have passed.
(We use this technique in our Web-Framework for load-balancing.)
(See the modules Startup and Config of our O³ Tools for BlackBox.)

Create file "Slave-running.empty"
Read in Parameter List or file
Do non blocking stuff, write Data-File
Delete file "Slave-running.empty"
exit using Kernel.Quit(0) (which prevents opening Pop-Up-Boxes)

ready



> >I am acquiring data
> >from a USB device using the standard Windows call
> >WinApi.DeviceIoControl. This call appears to be blocking,
> >i.e., it does not return unless the device sends the
> >requested data. In case the device does not have data,
> >the call stalls, and as a consequence BlackBox becomes
> >unresponsive (an hour glass appears on screen).
>
> Couldn't you simply use Blackbox's "Services.Action"
> routines to prevent the Blackbox framework from
> being unresponsive?
>
> Although I'll always second any suggestion to improve
> the multi-threading capabilities of Blackbox -- I've been
> suggesting this since 1996! In my case, I have a long
> running command which calls a Fortran DLL which in
> turns calls my Blackbox code. Unfortunately, whenever
> the Fortran DLL is being executed, the Blackbox
> framework becomes unresponsive and I can no longer
> do anything in it until the Fortran DLL is finished.
> And there doesn't appear to be any way to use the
> "Services.Action" routines to fix this. I also once
> tried using Windows process threads to try to workaround
> this, but this caused the Blackbox framework to crash.
>
> Marc Martin
> marc.martin{([at]})nowhere.xy
> Boeing Commercial Space Company
> --------------------------------------------
>
> To unsubscribe from this mailing list, send a message containing the word
> "unsubscribe" to: blackbox-request{([at]})nowhere.xy
>
> To get a list of valid e-mail commands and instructions on their usage,
> send a message containing the word "help" to the above address.
>
> Send any problem reports or questions related to this email list to the
> list owner at owner-blackbox{([at]})nowhere.xy
>
> Current posting policy:
>
> a) To post you should use the same address by which you are subscribed to
> the mailing list. That way, the list server will recognize you as
> subscriber and forward your posting immediately, without creating any
> overhead.
>
> b) If, for some reason, you cannot post from the address, by which you are
> subscribed, your message will be moderated to avoid spam. Please understand
> that moderation will often cause some delay, in particular over weekends or
> holydays.

-- 
mit freundlichen Grüssen
Werner Braun
O³ Software GmbH & Co. KG * Eichkamp 1 * D-24217 Schönberg
http://www.o3-software.de * Telefon: 04344 41417-2
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xyTo get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xyCurrent posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-848809537_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBc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B3aWxsIGJlIG1vZGVyYXRlZCB0
byBhdm9pZCBzcGFtLiBQbGVhc2UgdW5kZXJzdGFuZCB0aGF0IG1vZGVyYXRpb24gd2lsbCBvZnRl
biBjYXVzZSBzb21lIGRlbGF5LCBpbiBwYXJ0aWN1bGFyIG92ZXIgd2Vla2VuZHMgb3J9fQBhbSBh
Y3F1aXJpbmcgZA=
----boundary-LibPST-iamunique-848809537_-_---
Received on Thu Feb 20 2003 - 08:47:34 UTC

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