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

Henry Vermaak henry.vermaak at gmail.com
Wed Jun 23 13:21:35 CEST 2010


On 23/06/10 11:44, Michael Schnell wrote:
> On 06/22/2010 05:18 PM, Florian Klaempfl wrote:
>> At least according to Linus, the kernel api/syscall interface will never
>> break.
>>
> Regarding Threads, as far as I understand, the thread aware APIs (e.g.
> NPTL and FUTEX) have been added, while the other APIs were not affected.
> (No wonder, as I understand that the "Linux Threads" were constructed on
> top of the non-thread "process" APIs (e.g. fork and Inter-Process
> Semaphores) by the pthread library.

These "APIs" you're talking about, are just system calls.  There are no 
magic NPTL APIs: both NPTL and LinuxThreads use the "clone" system call. 
  In order to implement Posix threads, some things needed to be improved 
in the kernel, though, and there were also some new system calls (tls 
for x86/64, exit_group).  futex was added before NPTL, so NPTL uses them.

Read this article if you'd like to find out how this was implemented:

people.redhat.com/drepper/nptl-design.pdf

Henry



More information about the fpc-devel mailing list