1. A method of distributing and executing instances of code threads in a multiprocessor system having a plurality of processors, said method comprising: assigning a respective one of the processors to each code thread instance, and assigning either a hard affinity or a soft affinity to said each code thread instance so that said each code thread instance is either a hard affinity code thread instance or a soft affinity code thread instance; the processor assigned to each hard affinity code thread instance executing said each hard affinity code thread instance; and the processor assigned to each soft affinity code thread instance executing said each soft affinity code thread instance unless said each soft affinity code thread instance is ready and waiting for execution when another processor has no assigned soft affinity code thread instance ready and waiting for execution and finds that said each soft affinity code thread instance is ready and waiting for execution and executes said each soft affinity code thread instance ready and waiting for execution.