Re: Multithreading

From: [at]} <Werner>
Date: Thu, 20 Feb 2003 22:14:25 +0100

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

> >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.
>
> Clever! I can see how this might solve Wojtek's USB problem.
> I don't *think* this would be a very good solution for my
> particular situation, because of the rather convoluted way
> I need to interact between Blackbox->Fortran DLL->Blackbox,
> plus the long running command puts up some graphic displays
> to monitor progress and has some interactivity. Hmm...

Its no so bad / difficult anyway.
The several BlackBoxes can communicate using TCP/IP with CommTcp.
Thats what our Web-App-Server can do. One Master-Process (Server)
uses several Slave-Processes (Worker) and they communicate using
CommTcp.

> Frankly, all I'd really need is for Oberon Microsystems
> to add some sort of "yield" procedure, which would temporarily
> allow the Blackbox framework (and any Actions) to have
> some processor time during my long running command. Then
> I could call this repeatedly while I'm in the Fortran DLL.
> I even recall having some e-mail exchanges with someone at
> Oberon Microsystems back in 1996 who was considering adding
> something like this to Oberon/F v1.2, but I don't
> think it ever happened. I don't think this would add much
> of the complexity required for full-blown multi-threading,
> but it would sure solve my problem...

You can simply send Record-Data around using Stores.Store.
Write the data to a file. Copy the file via a CommTCP-Stream. Read the
data from the resulting file.
Then your Master-BB will start the Slave-BB and send / recieve the data using
an TCP/IP stream. Slave-BB will block sometimes which should be ne problem
anyway. Reading TCP/IP stream does not block. So if no bytes are there it just
returns. You can simply poll the stream using Services.Action.
And voila you have "poor mans CORBA".

Besides some drawbacks (speed) there is one big advantage using TCP/IP instead of Threads.
The co-working processes can run on different machines if you like.


-- 
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-1191476494_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCA+ID5DYWxsIFNsYXZlLVByb2Nl
c3MgSG9zdERpYWxvZy5TdGFydCgnQmxhY2tCb3ggL3BhciAibXkgcGFyYW1ldGVycyBvclxwYXIN
Cj4gPiBwYXJhbS1maWxlIiAnKSBVc2UgYSBTZXJ2aWNlLkFjdGlvbiBmb3IgcG9sbGluZyBpZiB0
aGUgZmlsZVxwYXINCj4gPiAiU2xhdmUtcnVubmluZy5lbXB0eSIgc3RpbGwgZXhpc3RzLiBBZnRl
ciB0aGUgZmlsZSBpcyBnb25lIHJlYWQgaW4gdGhlXHBhcg0KPiA+IGRhdGEgb3V0IG9mIHRoZSBw
YXJhbS1maWxlIG9yIGFueSBvdGhlciBkYXRhLWZpbGUuXHBhcg0KPlxwYXINCj4gQ2xldmVyISAg
SSBjYW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