Discussion:
Rexx XCTL like function?
(too old to reply)
ITschak Mugzach
2017-07-13 12:09:55 UTC
Permalink
Raw Message
Does rexx supports a kind of fork or xctl? I mean, a way to call a routine
without waiting for its completion.

ITschak

--
ITschak Mugzach
*|** IronSphere Platform* *|** Automatec ISCM** (Information Security
Contigious Monitoring) **| *

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
John McKown
2017-07-13 12:33:12 UTC
Permalink
Raw Message
Post by ITschak Mugzach
Does rexx supports a kind of fork or xctl? I mean, a way to call a routine
without waiting for its completion.
​"It depends". What is your environment? Batch, TSO, UNIX? In UNIX it is
easy:

=== stage1.rexx UNIX script

/* rexx */
say 'stage 1 starting'
stdin.0=0
stdout.0=0
stderr.0=0
rc=bpxwunix("~/bin/stage2.rexx &",stdin.)
say "stage 1 ending"


=== stage2.rexx UNIX script

/* rexx */
say "stage2 starting"
address syscall "sleep 30" /* sleep 30 seconds */
say "stage2 ending"


== result in TSO OMVS

:JOARMC:/u/joarmc/bin$
./stage1.rexx
stage 1 starting
stage 1 ending
stage2 starting
:JOARMC:/u/joarmc/bin$

:JOARMC:/u/joarmc/bin$
stage2 ending


​But I can't think, off hand, on how to do this in a normal IRXJCL or
IKJEFT01 execution in batch or even in a TSO script which is kept in a PDS
library.​
Post by ITschak Mugzach
ITschak
--
--
Veni, Vidi, VISA: I came, I saw, I did a little shopping.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
ITschak Mugzach
2017-07-13 12:39:14 UTC
Permalink
Raw Message
I am specifically interested in z/VM Rexx.

ITschak
Post by ITschak Mugzach
Post by ITschak Mugzach
Does rexx supports a kind of fork or xctl? I mean, a way to call a
routine
Post by ITschak Mugzach
without waiting for its completion.
​"It depends". What is your environment? Batch, TSO, UNIX? In UNIX it is
=== stage1.rexx UNIX script
/* rexx */
say 'stage 1 starting'
stdin.0=0
stdout.0=0
stderr.0=0
rc=bpxwunix("~/bin/stage2.rexx &",stdin.)
say "stage 1 ending"
=== stage2.rexx UNIX script
/* rexx */
say "stage2 starting"
address syscall "sleep 30" /* sleep 30 seconds */
say "stage2 ending"
== result in TSO OMVS
:JOARMC:/u/joarmc/bin$
./stage1.rexx
stage 1 starting
stage 1 ending
stage2 starting
:JOARMC:/u/joarmc/bin$
:JOARMC:/u/joarmc/bin$
stage2 ending

​But I can't think, off hand, on how to do this in a normal IRXJCL or
IKJEFT01 execution in batch or even in a TSO script which is kept in a PDS
library.​
Post by ITschak Mugzach
ITschak
--
--
Veni, Vidi, VISA: I came, I saw, I did a little shopping.
Maranatha! <><
John McKown
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
--
ITschak Mugzach
*|** IronSphere Platform* *|** Automatec ISCM** (Information Security
Contigious Monitoring) **| *

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Phil Smith III
2017-07-14 04:27:57 UTC
Permalink
Raw Message
Post by ITschak Mugzach
I am specifically interested in z/VM Rexx.
CMS multitasking is pretty specialized, so I'd have to say "no". The VM way
to do something like this might be to fire up another virtual machine,
though that's pretty heavyweight in some ways.

What are you actually trying to do?

...phsiii

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Glenn Knickerbocker
2017-08-06 00:13:34 UTC
Permalink
Raw Message
On 13 Jul 2017 21:27:57 -0700, in bit.listserv.tsorexx Phil Smith III
Post by Phil Smith III
Post by ITschak Mugzach
I am specifically interested in z/VM Rexx.
CMS multitasking is pretty specialized, so I'd have to say "no". The VM way
to do something like this might be to fire up another virtual machine,
though that's pretty heavyweight in some ways.
A more lightweight way is to move your REXX code into a CMS Pipelines
stage. Then it can use ADDPIPE to start up other pipelines that run
other REXX stages concurrently.

You're still limited to running one REXX instruction--or one command--at
a time. But if what you're after is to let one exec run while another
one waits for some external event, you can use Pipelines stages to do
that waiting: STARMSG to wait for messages, DELAY to wait for a time,
CONSOLE ASYNCHRONOUSLY to wait for console input, TCPCLIENT to wait for
responses over TCP/IP, etc. These stages suspend themselves and let
other stages run while they wait.

/* YOUWAIT REXX */
Trace C
'addpipe iwait'
Say "I'll wait one second."
'callpipe literal +1 | delay | cons'
Say "You can keep waiting."
Exit

/* IWAIT REXX */
Trace C
Say " I'll wait five seconds."
'callpipe literal +5 | delay | cons'
Say " I'm done waiting."
Exit

¬R

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2017-08-06 01:20:00 UTC
Permalink
Raw Message
Post by Glenn Knickerbocker
On 13 Jul 2017 21:27:57 -0700, in bit.listserv.tsorexx Phil Smith III
Post by Phil Smith III
Post by ITschak Mugzach
I am specifically interested in z/VM Rexx.
CMS multitasking is pretty specialized, so I'd have to say "no". The VM way
to do something like this might be to fire up another virtual machine,
though that's pretty heavyweight in some ways.
A more lightweight way is to move your REXX code into a CMS Pipelines
stage. Then it can use ADDPIPE to start up other pipelines that run
other REXX stages concurrently.
You're still limited to running one REXX instruction--or one command--at
a time. ...
You can run multiple instructions, but only one command and
no instructions at a time. For this purpose, CALLPIPE may not
count as a command.
Post by Glenn Knickerbocker
... But if what you're after is to let one exec run while another
one waits for some external event, you can use Pipelines stages to do
that waiting: STARMSG to wait for messages, DELAY to wait for a time,
CONSOLE ASYNCHRONOUSLY to wait for console input, TCPCLIENT to wait for
responses over TCP/IP, etc. These stages suspend themselves and let
other stages run while they wait.
TCPCLIENT is marvelous. But I've never used it depending on concurrency.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Glenn Knickerbocker
2017-08-06 17:25:11 UTC
Permalink
Raw Message
Post by Paul Gilmartin
Post by Glenn Knickerbocker
You're still limited to running one REXX instruction--or one command--at
a time. ...
You can run multiple instructions, but only one command and
no instructions at a time. For this purpose, CALLPIPE may not
count as a command.
Well, I guess it depends on the exact sense of "run." In the same sense
in which a REXX routine must explicitly return control to its caller
before the caller can run again, a pipeline stage must explicitly suspend
itself before another stage can run. If you start up a pipeline with two
REXX stages that never issue any Pipelines subcommands that suspend them,
one will start and finish before the other ever starts running.

It's more than just CALLPIPE: COMMIT, OUTPUT, PEEKTO, READTO, and SELECT
ANYINPUT all suspend the stage to let others run.

¬R

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Loading...