On Wed, 13 Oct 2010, Andrew Brunner wrote:

On Wed, Oct 13, 2010 at 2:12 PM, Michael Van Canneyt
<mich...@freepascal.org> wrote:

FPC doesn't have anything to say about CPU allocation. The threads are
created by the C pthread library and Linux kernel.
They do the heavy work.

Is it possible I have the pthread library in some sort of debug mode
that is slowing down the process of thread creation?

I seriously doubt it.
What you could do to test, is write your program using direct Pthread calls. This way we can ascertain whether it is the FPC or Pthread code which is the bottleneck.

If need be, I can dig up my texts for the Kylix book, it describes how to do this in Object Pascal. I suspect the code would still be pretty much the same.


What is needed to get directly to kernel api to /queue
events/create/destroy/suspend/resume threads?

Are there any alternatives to the cthreads unit?

Yes, write an object pascal version of it, which accesses the kernel directly and bypasses the C library.

It has been on many people's wish list for ages.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to