In this work we consider the problem of dynamic load balancing in an n processors parallel system. We focus on the algorithm which randomly assigns newly generated tasks to processors for execution. This process is modeled by randomly throwing weighted balls into n holes. For a given program A, the ball weights (task lengths) are chosen according to an unknown probability distribution D(A) with expectation μ, maximum M and minimum m. For any A, D(A) and a constant 0<ε≤0.5, we derive an upper bound on the number of processes which A needs to generate in order for the algorithm to achieves optimal load balancing with very high probability, so that the run-time is optimal up to a factor of (1+ε)2. Using the relation derived, the programmer may control the load-balancing of his program by modifying the global parameters of the generated processes.