Home | History | Annotate | Line # | Download | only in libpthread
TODO revision 1.8.2.2
      1  1.8.2.2     skrll $NetBSD: TODO,v 1.8.2.2 2007/09/03 10:14:13 skrll Exp $
      2      1.5        ad 
      3      1.8        ad Bugs to fix:
      4      1.2   thorpej 
      5      1.2   thorpej - Add locking to ld.elf_so so that multiple threads doing lazy binding
      6  1.8.2.2     skrll   doesn't trash things.
      7      1.2   thorpej 
      8      1.8        ad Interfaces/features to implement:
      9      1.2   thorpej 
     10  1.8.2.2     skrll - Priority scheduling.
     11      1.8        ad 
     12  1.8.2.2     skrll - Priority inheritance.
     13      1.8        ad 
     14  1.8.2.2     skrll - Figure out whether/how to use registers reserved in the ABI for
     15  1.8.2.2     skrll   thread-specific-data to implement pthread_self().
     16      1.8        ad 
     17      1.4  christos - Figure out what to do with changing stack sizes.
     18      1.5        ad 
     19      1.6      yamt - A race between pthread_exit() and pthread_create() for detached LWPs,
     20      1.6      yamt   where the stack (and pthread structure) could be reclaimed before the
     21      1.6      yamt   thread has a chance to call _lwp_exit(), is currently prevented by
     22      1.6      yamt   checking the return of _lwp_kill(target, 0).  It could be done more
     23      1.6      yamt   efficiently.  (See shared page item.)
     24      1.5        ad 
     25  1.8.2.1     skrll - Adaptive mutexes and spinlocks (see shared page item).
     26      1.5        ad 
     27      1.5        ad - Have a shared page that:
     28      1.5        ad 
     29      1.5        ad   o Allows an LWP to request it not be preempted by the kernel. This would
     30      1.5        ad     be used over critical sections like pthread_cond_wait(), where we can
     31      1.5        ad     acquire a bunch of spin locks: being preempted while holding them would
     32      1.5        ad     suck. _lwp_park() would reset the flag once in kernel mode, and there
     33      1.5        ad     would need to be an equivalent way to do this from user mode. The user
     34      1.5        ad     path would probably need to notice deferred preemption and call
     35      1.5        ad     sched_yield() on exit from the critical section.
     36      1.5        ad 
     37      1.5        ad   o Perhaps has some kind of hint mechanism that gives us a clue about
     38      1.5        ad     whether an LWP is currently running on another CPU. This could be used
     39      1.5        ad     for adaptive locks, but would need to be cheap to do in-kernel.
     40      1.5        ad 
     41      1.5        ad   o Perhaps has a flag value that's reset when a detached LWP is into the
     42      1.5        ad     kernel and lwp_exit1(), meaning that its stack can be reclaimed. Again,
     43      1.5        ad     may or may not be worth it.
     44      1.5        ad 
     45      1.5        ad - Keep a pool of dead LWPs so that we do not have take the full hit of
     46  1.8.2.2     skrll   _lwp_create() every time pthread_create() is called.
     47      1.5        ad 
     48      1.5        ad - Need to give consideration to the order in which threads enter and exit
     49      1.5        ad   synchronisation objects, both in the pthread library and in the kernel.
     50      1.8        ad   Commonly locks are acquired/released in order (a, b, c -> c, b, a).
     51