Home | History | Annotate | Line # | Download | only in libpthread
TODO revision 1.2
      1  1.2  thorpej Bugs to fix:
      2  1.2  thorpej 
      3  1.2  thorpej - pthread_cond_timedwait() doesn't work if SA's aren't running yet,
      4  1.2  thorpej   because the alarm system isn't up and running. It would be weird to
      5  1.2  thorpej   use them that way, but it's perfectly legal.
      6  1.2  thorpej - There is a race between pthread_cancel() and
      7  1.2  thorpej   pthread_cond_broadcast() or pthread_exit() about removing an item
      8  1.2  thorpej   from the sleep queue. The locking protocols there need a little
      9  1.2  thorpej   adjustment.
     10  1.2  thorpej - pthread_sig.c: pthread__signal_tramp() is broken.  It gets a ucontext,
     11  1.2  thorpej   but then hands off an empty (garbage from stack!) sigcontext to the
     12  1.2  thorpej   handler.  The ucontext MUST be converted to a sigcontext, the handler
     13  1.2  thorpej   called, and then the sigcontext converted back to ucontext, before the
     14  1.2  thorpej   ucontext is used to perform the sigreturn-analogue.  This is necessary
     15  1.2  thorpej   for e.g. C++/Java exceptions and some garbage-collectors.
     16  1.2  thorpej - pthread_sig.c: pthread__signal_tramp() should be changed so that it is
     17  1.2  thorpej   easy to add support for SA_SIGINFO later.  (Mostly a function signature
     18  1.2  thorpej   issue.)
     19  1.2  thorpej - pthread_sig.c: Come up with a signal trampoline naming convention like
     20  1.2  thorpej   libc's, so that GDB will have an easier time with things.
     21  1.2  thorpej - Consider moving pthread__signal_tramp() to its own file, and building
     22  1.2  thorpej   it with -fasync-unwind-tables, so that DWARF2 EH unwinding works through
     23  1.2  thorpej   it.  (This is required for e.g. GCC's libjava.)
     24  1.2  thorpej - Add locking to ld.elf_so so that multiple threads doing lazy binding
     25  1.2  thorpej   doesn't trash things.
     26  1.2  thorpej - Verify the cancel stub symbol trickery.
     27  1.2  thorpej 
     28  1.2  thorpej 
     29  1.2  thorpej Interfaces/features to implement:
     30  1.2  thorpej - pthread_kill()
     31  1.2  thorpej - pthread_atfork()
     32  1.2  thorpej - priority scheduling
     33  1.2  thorpej - libc integration: 
     34  1.2  thorpej    - foo_r interfaces
     35  1.2  thorpej - system integration
     36  1.2  thorpej    - some macros and prototypes belong in headers other than pthread.h
     37  1.2  thorpej 
     38  1.2  thorpej 
     39  1.2  thorpej Features that need more/better regression tests:
     40  1.2  thorpej  - pthread_cond_broadcast()
     41  1.2  thorpej  - pthread_once()
     42  1.2  thorpej  - pthread_get/setspecific()
     43  1.2  thorpej  - signals
     44  1.2  thorpej 
     45  1.2  thorpej 
     46  1.2  thorpej Things that need fixing:
     47  1.2  thorpej - Recycle dead threads for new threads.
     48  1.2  thorpej 
     49  1.2  thorpej Ideas to play with:
     50  1.2  thorpej - Explore the trapcontext vs. usercontext distinction in ucontext_t.
     51  1.2  thorpej - Get rid of thread structures when too many accumulate (is this
     52  1.2  thorpej   actually a good idea?)
     53  1.2  thorpej - Adaptive spin/sleep locks for mutexes.
     54  1.2  thorpej - Currently, each thread uses two real pages of memory: one at the top
     55  1.2  thorpej   of the stack for actual stack data, and one at the bottom for the
     56  1.2  thorpej   pthread_st. If we can get suitable space above the initial stack for
     57  1.2  thorpej   main(), we can cut this to one page per thread. Perhaps crt0 should
     58  1.2  thorpej   do something different (give us more space) if libpthread is linked
     59  1.2  thorpej   in?
     60  1.2  thorpej - Figure out whether/how to expose the inline version of
     61  1.2  thorpej   pthread_self().
     62  1.2  thorpej - Along the same lines, figure out whether/how to use registers reserved
     63  1.2  thorpej   in the ABI for thread-specific-data to implement pthread_self().
     64