TODO revision 1.3
11.2SthorpejBugs to fix: 21.2Sthorpej 31.3Sjdolecek- some blocking routines (like sem_wait()) don't work if SA's aren't 41.3Sjdolecek running yet, because the alarm system isn't up and running or there is no 51.3Sjdolecek thread context to switch to. It would be weird to use them that 61.3Sjdolecek way, but it's perfectly legal. 71.2Sthorpej- There is a race between pthread_cancel() and 81.2Sthorpej pthread_cond_broadcast() or pthread_exit() about removing an item 91.2Sthorpej from the sleep queue. The locking protocols there need a little 101.2Sthorpej adjustment. 111.2Sthorpej- pthread_sig.c: pthread__signal_tramp() is broken. It gets a ucontext, 121.2Sthorpej but then hands off an empty (garbage from stack!) sigcontext to the 131.2Sthorpej handler. The ucontext MUST be converted to a sigcontext, the handler 141.2Sthorpej called, and then the sigcontext converted back to ucontext, before the 151.2Sthorpej ucontext is used to perform the sigreturn-analogue. This is necessary 161.2Sthorpej for e.g. C++/Java exceptions and some garbage-collectors. 171.2Sthorpej- pthread_sig.c: pthread__signal_tramp() should be changed so that it is 181.2Sthorpej easy to add support for SA_SIGINFO later. (Mostly a function signature 191.2Sthorpej issue.) 201.2Sthorpej- pthread_sig.c: Come up with a signal trampoline naming convention like 211.2Sthorpej libc's, so that GDB will have an easier time with things. 221.2Sthorpej- Consider moving pthread__signal_tramp() to its own file, and building 231.2Sthorpej it with -fasync-unwind-tables, so that DWARF2 EH unwinding works through 241.2Sthorpej it. (This is required for e.g. GCC's libjava.) 251.2Sthorpej- Add locking to ld.elf_so so that multiple threads doing lazy binding 261.2Sthorpej doesn't trash things. 271.2Sthorpej- Verify the cancel stub symbol trickery. 281.2Sthorpej 291.2Sthorpej 301.2SthorpejInterfaces/features to implement: 311.2Sthorpej- pthread_atfork() 321.2Sthorpej- priority scheduling 331.2Sthorpej- libc integration: 341.2Sthorpej - foo_r interfaces 351.2Sthorpej- system integration 361.2Sthorpej - some macros and prototypes belong in headers other than pthread.h 371.2Sthorpej 381.2Sthorpej 391.2SthorpejFeatures that need more/better regression tests: 401.2Sthorpej - pthread_cond_broadcast() 411.2Sthorpej - pthread_once() 421.2Sthorpej - pthread_get/setspecific() 431.2Sthorpej - signals 441.2Sthorpej 451.2Sthorpej 461.2SthorpejThings that need fixing: 471.2Sthorpej- Recycle dead threads for new threads. 481.2Sthorpej 491.2SthorpejIdeas to play with: 501.2Sthorpej- Explore the trapcontext vs. usercontext distinction in ucontext_t. 511.2Sthorpej- Get rid of thread structures when too many accumulate (is this 521.2Sthorpej actually a good idea?) 531.2Sthorpej- Adaptive spin/sleep locks for mutexes. 541.2Sthorpej- Currently, each thread uses two real pages of memory: one at the top 551.2Sthorpej of the stack for actual stack data, and one at the bottom for the 561.2Sthorpej pthread_st. If we can get suitable space above the initial stack for 571.2Sthorpej main(), we can cut this to one page per thread. Perhaps crt0 should 581.2Sthorpej do something different (give us more space) if libpthread is linked 591.2Sthorpej in? 601.2Sthorpej- Figure out whether/how to expose the inline version of 611.2Sthorpej pthread_self(). 621.2Sthorpej- Along the same lines, figure out whether/how to use registers reserved 631.2Sthorpej in the ABI for thread-specific-data to implement pthread_self(). 64