[fpc-devel] Threading support and C library under Linux/Unix
Michael Van Canneyt
michael at freepascal.org
Tue Jun 22 14:55:28 CEST 2010
On Tue, 22 Jun 2010, Graeme Geldenhuys wrote:
> Op 2010-06-22 14:24, Marco van de Voort het geskryf:
>>
>> No, not straight away. That is technically impossible without integrating a
>> full C compiler, since POSIX requires to be able to read and interpret
>
>
> And what if one implements a non-posix based implementation (of Free
> Pascal's own design) support for kernel threading? eg: Start with Linux,
> then implement others like OSX or *BSD if they support kernel threading. I
> did a quick Google search, and there are a lot of multi-threading libraries
> which implement kernel or user-space multi-threading which are not based on
> POSIX standard.
>
> Here is one such list - there are many more. Not all listed in this link
> are POSIX based.
>
> http://linas.org/linux/threads-faq.html
>
>
> The WINE project faced a similar problem. How to implement multi-threading
> support from Win32 on a Linux kernel that didn't have all the same features
> or API. Read the page linked for more information - it makes for
> interesting reading.
>
> http://www.winehq.org/docs/winedev-guide/threading
>
>
> Anyway, my first thoughts is the same as Henry's - what would change
> between distros?
For the kernel interface: Not so much. (on some archs, FUTEX is missing).
The problem starts if you start linking to C libraries. In that case you're
pretty much forced to use pthreads; each distribution can make different
choices when compiling libc.
It would be nice to have a kernel interface, though. That way you could have
threading support without pulling in libc.
Michael.
More information about the fpc-devel
mailing list