[fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

Sven Barth pascaldragon at googlemail.com
Thu Oct 14 09:35:32 CEST 2010


Am 14.10.2010 09:28, schrieb Michael Van Canneyt:
>>> Yes, write an object pascal version of it, which accesses the kernel
>>> directly and bypasses the C library.
>>
>> That's exactly what I'm thinking. There are only like 36 methods to
>> implement. Depending on how hard will be to hook into the kernel...
>
> The kernel thing is easy, just a vfork() call, if I'm correct.
> It's all the rest that is difficult: synchronization, mutex, semaphores :)
>

I don't know about other Unix variants, but for Linux one should use 
"clone" to create a thread.

See also this example by - I believe - Linus himself: 
http://www.ibiblio.org/pub/Linux/docs/faqs/Threads-FAQ/html/clone.c

Regards,
Sven



More information about the fpc-pascal mailing list