TABLE OF CONTENTS


Threads

DESCRIPTION

While 'run -bg' and 'runXX -bg' commands can only run executables in background, threads instead can run script excerpts in parallel asynchronously. Hence, they are a much more flexible way of a background parallel execution than the 'run* -bg' commands.

The Tcl thread package is required to use threads in PWTK (N.B. the Thread package is named 'tcl-thread' in Linux distros).

WARNING

Note that bgs (aka backgrounds, see ::pwtk::bg) are safer to use than threads because bgs are completely independent from one another, whereas threads share some resources such as current working directory and enviromental variables. If one thread changes the current working directory, then that change affects all threads.