Blitz (110/176)

From:Thilo K�hler
Date:27 Jul 2001 at 13:21:27
Subject:Re: Spawning tasks

Hello !

I have a solution which is quite a bit rough
but it works. I run my programm like normal
and then run a second with *execute_*.
As an CLI argument I give a pointer to my
variable base. Then I use signals to controll
my "Subtask" and tell it when to exit.
It is not very pretty I know, but you can use the debugger
on both tasks.

Restrictions:
- Don`t write strings within the subtask, read only
- You have to put a forbid_ / permit_ pair around
the access of those variables, as I guess the
access of varaibles is not an atomic operation.

It looks like this:

____________________________ main:
*NewType* my_vars
x.l
y.l
blabla.l
*End* *NewType*

*Deftype*.my_vars my_varbase

*execute*_ "run subtask.exe"+*str*$(&my_varbase),0,0
...
my_varbase\blabla = 1234567
...
*END*

____________________________ subtask
*NewType* my_vars
x.l
y.l
blabla.l
*End* *NewType*

*my_varbase.my_vars = *val*(*par*$(1))
...
*my_varbase\blabla = *my_varbase\blabla +1
...
*END*

It works quite well if yu have not much variables to share,
only some pointers or a counter.

Ciao,

Thilo

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie