Browse Prior Art Database

Multiple Threads of Execution in REXX Programs

IP.com Disclosure Number: IPCOM000113312D
Original Publication Date: 1994-Aug-01
Included in the Prior Art Database: 2005-Mar-27
Document File: 2 page(s) / 33K

Publishing Venue

IBM

Related People

Cohen, ML: AUTHOR [+4]

Abstract

A method is described which identifies a new mechanism for multiple concurrent threads of execution in REXX programs.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 89% of the total text.

Multiple Threads of Execution in REXX Programs

      A method is described which identifies a new mechanism for
multiple concurrent threads of execution in REXX programs.

      A new function is provided, called rxRexxThread, which uses
OS/2* services to start a separate REXX program in a separate thread
of execution.  Externally, for example, the REXX programmer could
write the following code:

  /* func1.cmd */
   /* register the function in the usual way */
   call rxfuncadd "rxRexxThread", "RXTEND", "rxRexxThread"
   ...
   /* start another REXX program in a separate thread */
   call rxRexxThread("func2.cmd")
  ...

The effect is to start func2.cmd and immediately continue execution
of func1.cmd.  This was previously not possible in REXX.

      Internally, the rxRexxThread function uses OS/2 system calls to
start a new thread, within which the REXX command interpreter is
invoked, passing the name of the second REXX program.  The algorithm
is given below:
 function RxRexxThread (fileName, parmList, result)
 begin
    args = parmList   // make a new copy of parmList
    // allocate stack space for the new thread
    call beginthread(rexxthread, args, stack)
    // copy the thread id into result
    return result
 end
 rexxthread(args)
 begin
    call REXXSAA(fileName, args) // start the new program
    // after the program ends, kill this thread
    call endthread
 end

      Any number of threads can be star...