Feature #116
TLS for thread IDs and such
| Status: | Closed | Start: | 08/26/2010 | |
|---|---|---|---|---|
| Priority: | High | Due date: | 08/31/2010 | |
| Assigned to: | % Done: | 100% |
||
| Category: | Kernel | Spent time: | 1.00 hour | |
| Target version: | Foster Post-Release Milestone #1 | Estimated time: | 3.00 hours |
Description
We need TLS for, at least, the thread ID to be stored to improve performance of pthread_self (and avoid syscall flood). Input is currently being delayed by the flood of pthread_self system calls coming from SDL applications.
This will involve allocating a number of pages of memory as a "TLS area" for each userspace thread created, the address of which is put into the GDT entry for the segment in FS or GS on each task switch (x86-specific, other architectures have alternative mechanisms).
Threads access TLS areas via a simple memory access using FS/GS as the segment.