Home | History | Annotate | Line # | Download | only in libpthread
TODO revision 1.1.2.12
      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: sigaction() currently hard-codes __sigtramp_sigcontext_1:
     11   this is incorrect.  Instead of calling __sigaction_sigtramp() directly,
     12   libc should export a __libc_sigaction14() which sigaction() can call.
     13   Also, pthread_sig.c should probably be built with __LIBC12_SOURCE__ so
     14   that the signal version of sigaction(), et al can be explicit.
     15 - pthread_sig.c: pthread__signal_tramp() is broken.  It gets a ucontext,
     16   but then hands off an empty (garbage from stack!) sigcontext to the
     17   handler.  The ucontext MUST be converted to a sigcontext, the handler
     18   called, and then the sigcontext converted back to ucontext, before the
     19   ucontext is used to perform the sigreturn-analogue.  This is necessary
     20   for e.g. C++/Java exceptions and some garbage-collectors.
     21 - pthread_sig.c: pthread__signal_tramp() should be changed so that it is
     22   easy to add support for SA_SIGINFO later.  (Mostly a function signature
     23   issue.)
     24 - Consider moving pthread__signal_tramp() to its own file, and building
     25   it with -fasync-unwind-tables, so that DWARF2 EH unwinding works through
     26   it.  (This is required for e.g. GCC's libjava.)
     27 - locks: Add support for RAS on uniprocessors.
     28 - pthread_lock.c: pthread_spin_lock() should use a loop around
     29   __cpu_simple_lock_try() so that it is easy to add support for RAS.
     30 - Add locking to ld.elf_so so that multiple threads doing lazy binding
     31   doesn't trash things.
     32 
     33 
     34 Interfaces/features to implement:
     35 - pthread_kill()
     36 - pthread_atfork()
     37 - pthread_rwlock... These are currently stubbed to MUTEX in libc!!
     38 - priority scheduling
     39 - libc integration: 
     40    - foo_r interfaces
     41 - system integration
     42    - some macros and prototypes belong in headers other than pthread.h
     43 
     44 
     45 Features that need more/better regression tests:
     46  - pthread_cond_broadcast()
     47  - pthread_once()
     48  - pthread_get/setspecific()
     49  - signals
     50 
     51 
     52 Things that need fixing:
     53 - Recycle dead threads for new threads.
     54 
     55 Ideas to play with:
     56 - Explore the trapcontext vs. usercontext distinction in ucontext_t.
     57 - Get rid of thread structures when too many accumulate (is this
     58   actually a good idea?)
     59 - Adaptive spin/sleep locks for mutexes.
     60 - Supporting different mutex types would be nice (normal, debugging,
     61   recursive, etc).
     62 - Currently, each thread uses two real pages of memory: one at the top
     63   of the stack for actual stack data, and one at the bottom for the
     64   pthread_st. If we can get suitable space above the initial stack for
     65   main(), we can cut this to one page per thread. Perhaps crt0 should
     66   do something different (give us more space) if libpthread is linked
     67   in?
     68 - Figure out whether/how to expose the inline version of
     69   pthread_self().
     70