On Wed, Mar 21, 2001 at 06:35:26PM -0800, Srinath, Srivatsa wrote:
> If it executes sequentially, then I can just make function calls instead of
> creating threads isnt it? Or, is there a way that I can make it work
> differently?
No, pth provides non-preemptive threads. If you need preemptive threads then
use POSIX threads (which are available on any modern Unix variant.)
Non-preemptive threads are great for things like discrete event simulations
(or any other application where threads make sense but preemption isn't
necessary.) One simple simulation I ran took over 2 minutes to run using
POSIX threads. Most of this time was spent just switching between threads.
The same simulation converted to use pth took only 8 seconds to run.
--
Note: See http://www.members.home.net/graywane/ for PGP information.
PGP signature