Clearly, if an application makes heavy use of CPU intensive routines in the Karma library, the benefits gained from a multi-CPU platform are automatically gained without the need for any intervention by the application programmer. Of greater interest is the support provided for the application programmer to parallelise code. This is all provided by the mt package. The mt package allows the application programmer to create a pool of threads onto which jobs may be launched. To make use of multi-threading, you first need to create a pool of threads onto which you can launch jobs.
Threads sit idle until they are given a job.
It corresponds to a function that is called by the thread it runs on. They last a short time and are run on the first available idle thread. The actual execution order of jobs is unpredictable. Typically an algorithm divides up the work to be done and has one job function which is launched many times, once for each part of the work. It is usually better to divide the work into far more jobs than there are threads.