TODO revision 1.3 1 1.2 thorpej Bugs to fix:
2 1.2 thorpej
3 1.3 jdolecek - some blocking routines (like sem_wait()) don't work if SA's aren't
4 1.3 jdolecek running yet, because the alarm system isn't up and running or there is no
5 1.3 jdolecek thread context to switch to. It would be weird to use them that
6 1.3 jdolecek way, but it's perfectly legal.
7 1.2 thorpej - There is a race between pthread_cancel() and
8 1.2 thorpej pthread_cond_broadcast() or pthread_exit() about removing an item
9 1.2 thorpej from the sleep queue. The locking protocols there need a little
10 1.2 thorpej adjustment.
11 1.2 thorpej - pthread_sig.c: pthread__signal_tramp() is broken. It gets a ucontext,
12 1.2 thorpej but then hands off an empty (garbage from stack!) sigcontext to the
13 1.2 thorpej handler. The ucontext MUST be converted to a sigcontext, the handler
14 1.2 thorpej called, and then the sigcontext converted back to ucontext, before the
15 1.2 thorpej ucontext is used to perform the sigreturn-analogue. This is necessary
16 1.2 thorpej for e.g. C++/Java exceptions and some garbage-collectors.
17 1.2 thorpej - pthread_sig.c: pthread__signal_tramp() should be changed so that it is
18 1.2 thorpej easy to add support for SA_SIGINFO later. (Mostly a function signature
19 1.2 thorpej issue.)
20 1.2 thorpej - pthread_sig.c: Come up with a signal trampoline naming convention like
21 1.2 thorpej libc's, so that GDB will have an easier time with things.
22 1.2 thorpej - Consider moving pthread__signal_tramp() to its own file, and building
23 1.2 thorpej it with -fasync-unwind-tables, so that DWARF2 EH unwinding works through
24 1.2 thorpej it. (This is required for e.g. GCC's libjava.)
25 1.2 thorpej - Add locking to ld.elf_so so that multiple threads doing lazy binding
26 1.2 thorpej doesn't trash things.
27 1.2 thorpej - Verify the cancel stub symbol trickery.
28 1.2 thorpej
29 1.2 thorpej
30 1.2 thorpej Interfaces/features to implement:
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