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