[fpc-devel] Threading support and C library under Linux/Unix

Henry Vermaak henry.vermaak at gmail.com
Tue Jun 22 15:22:42 CEST 2010


On 22 June 2010 14:16, Michael Van Canneyt <michael at freepascal.org> wrote:
>
>
> On Tue, 22 Jun 2010, Henry Vermaak wrote:
>
>> On 22 June 2010 13:55, Michael Van Canneyt <michael at freepascal.org> wrote:
>>>
>>> The problem starts if you start linking to C libraries. In that case
>>> you're
>>> pretty much forced to use pthreads;
>>
>> Why is that?  I thought you could use anything, as long as it's posix
>> compliant?
>
> Because the library will make certain assumptions on how a thread is
> started. If the thread is started from FPC code, then most likely some
> pthread structures will not have been created for that thread, causing
> errors.
>
> Likewise, the current FPC threading code assumes that all threads are
> created
> through the FPC code. If this is not the case, and some external C code
> creates a thread, you'll get errors in the FPC code.

Well, this is a good reason for getting fpc threading posix compliant, then, no?



More information about the fpc-devel mailing list