2015-02-26 18:50 GMT+08:00 Henry Vermaak <henry.verm...@gmail.com>: > > > > Sleep is for granting the CPU for other processes for (at least) a > > predefined time. > > > > See the mail of the original poster: this is what he asked for. > > Thats right.
> This is incorrect, since if you pause a thread with sleep(), you'll have > to loop to check when you're supposed to wake up. > I use rtlevent, but only meant to maintain a pool of threads, while there is no task for a thread it is blocked waiting for an event. BUT, that cannot be used to prioritize a thread. While you block a thread using rtlevent, it can only be unblocked from another thread. While you use sleep(), it still get time share of the CPU, only that it does nothing until sleep finishes, right? That way, it only consume a tiny amount of computing power while sleeping. This, in my view, is the price I have to pay to achieve my purpose?
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal