home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
SAMPLES
/
COMPILER
/
SAMPLE02
/
READ.ME
< prev
next >
Wrap
Text File
|
1993-03-13
|
1KB
|
43 lines
This program demonstrates the multithread programming capability of the IBM C
Set/2 compiler.
This sample program creates one thread for each argument. Each thread prints
"Hello world from thread n!" the number of times specified in the
corresponding argument. For example
SAMPLE02 2 4 6
creates three threads; the first thread displays "Hello" two times, the
second thread displays "Hello" four times, and the third thread displays
"Hello" six times.
The files for the sample program are:
SAMPLE02.C The source file for the multithread program
In operation, the program works in the following order:
1. Creates the requested number of threads
2. Waits until all threads have been created
3. Begins multithread execution and waits for completion
SAMPLE02.DEF The module definition file for the EXE.
To build the sample program, use the supplied make files:
MAKE02S - Builds SAMPLE02.EXE. The compiler libraries are linked statically.
MAKE02D - Builds SAMPLE02.EXE. The compiler libraries are linked dynamically.
NOTE: The program requires the IBM TOOLKIT 2.0 headers.
For example:
nmake all -f make02d
To clean up after the sample program has been built and run, type the following
command:
nmake clean -f make02d