[fpc-devel] Threading support and C library under Linux/Unix
Michael Van Canneyt
michael at freepascal.org
Tue Jun 22 15:16:40 CEST 2010
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.
Michael.
More information about the fpc-devel
mailing list