Generic master/worker programs:
- Supporting code:
FakeTasks.java.
- Sequential version:
seq/MasterWorkerSeq.java.
- Multi-threaded versions:
- Client-server versions using sockets:
To execute: Compile everything, and then run either
sockets/Master1 or sockets/Master2 as the master,
plus one or more workers.
The start-workers script below may be useful.
- Client-server version using RMI:
To execute: Compile everything, start an instance of
the registry with the command "rmiregistry" (in the
directory containing the .class files), and
then run one master and one or more workers.
The start-workers script below may be useful.
- Script start-workers
to start "worker" processes on selected machines.
(Somewhat preliminary version.)
To use, copy into a directory in your search path
(current directory will probably work) and make executable
with chmod u+x start-workers.
Executing with no arguments gives a usage message.
OpenCL
POSIX Threads
- Sample makefile Makefile
for compiling C and C++ programs.
(See the Note About
Makefiles below.)
- Utility functions for use with examples:
timer.h,
cmdline.h.
- "Hello, world" program:
hello.c,
- Simple example of synchronization among threads:
- Programs to compute pi by numerical integration:
C++11 Threads
To obtain a makefile, use your browser's download function;
cutting and pasting will likely turn the tabs in the makefile
into spaces and cause it to not work.
Put the makefile in the directory in which you want to
compile.
All the makefiles linked from this page begin with
brief documentation on their use (the "usage examples").