home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
mtseek.zip
/
MTSEEK.DOC
< prev
next >
Wrap
Text File
|
1995-01-19
|
1KB
|
29 lines
Program Title: MThread
Author: Scot Gould 1/95
There are no threads and there are no semaphores for signalling in
generic OS/2 REXX, however here is:
An example of using Rexx to create multithreaded programs with semaphores
and queues. This is a template for other multithreaded REXX programs.
This example searches files for desired text and places a list of
files containing the text in one OS/2 Window. A second OS/2 window is
used for user input. The user can select which file to edit by entering
the appropriate file number.
The main program runs two processes (hence the multitasking). One is
the user input and the second is the detach processes searching
the files.
The processes converse with the main program through a queue. A parse
checks to see which process has sent a message.
A semaphore is used to signal the detached process to stop searching.
The semaphore is a file that is deleted when the process should
terminate. The detached process checks the existance of the file
for a signal.
No idiot proofing has been performed. These files are used to
represent a simple example.