[Lazarus] Thread's stack size

David W Noon david.w.noon at ntlworld.com
Mon Jun 15 20:49:31 CEST 2009


On Mon, 2009-06-15 at 19:20 +0200, Andreas Berger wrote:

> David W Noon wrote:
> > You need to create a custom class that inherits from TThread. In the
> > constructor of your class you can specify a stack size using an
> > "inherited" statement. If you want some sample code, just ask.
> >   
> Yes, since I would need to call the derived TThread's inherited 
> constructor and not TThread itself. I wouldn't know how to do that. I 
> would especially be interrested in the Linux code since I don't really 
> know the Linux API.

Attached is a zip archive of some source code. It also includes some
declarations of the raw Linux/POSIX API, so it will also show you how to
incorporate [g]libc functions into your Pascal code.

Note that you need to ensure that your glibc build includes NPTL (Native
POSIX Threading Library), as most of the modern API calls will not work
with the old (and rather trashy) LinuxThreads library.

If you need any explanations, just ask.

[Just as an aside, this thread would have been more on-topic in the
fpc-user mailing list, as it isn't Lazarus-specific.]

-- 
Regards,

Dave  [RLU #314465]
=======================================================================
david.w.noon at ntlworld.com (David W Noon)
=======================================================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thread_test.zip
Type: application/zip
Size: 2932 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20090615/18d1e030/attachment-0004.zip>


More information about the Lazarus mailing list