On Fri, Oct 15, 2010 at 10:24 AM, Sven Barth <pascaldra...@googlemail.com> wrote: > The problem isn't the pthreads library. The problem is the POSIX threading > specification of which pthreads is an implementation (look at the comment in > CSuspendThread again).
POSIX is just like you say a specification. Suspend and Resume is a feature. There are many ways to implement a feature such as suspend and resume. A semaphore is one way. Unfortunately, because FPC uses PThreads and PThreads uses libc FPC apps get slow during a high scale thread creation process where a barrier is required. I was able to work around not having an RTLEvent per thread to bybass in this case, but other cases will come where I need to have events or signals going to each thread. And if a semaphore is created for each thread object over each "layer" to implement you can see these inefficiencies compound. If we go native, at lease we can share the 1 semaphore that is needed to introduce suspend and resume features. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal