Add an rc script for starting vkernels upon boot.
[dragonfly.git] / lib / libpthread / README
CommitLineData
5ab852b8 1$DragonFly: src/lib/libpthread/README,v 1.3 2008/02/09 00:28:26 swildner Exp $
4491bca1
SS
2
3Proxy libpthread
4================
5
6We want to be able to switch between threading libraries at execution
5ab852b8 7time. This problem is solved by this proxy libpthread.
4491bca1 8
a4bded30
SS
9The operation at link time is as follows.
10libc.so anyways defines all pthread functions as weak symbols
4491bca1
SS
11except for pthread_create. libpthread.so now also defines a dummy
12pthread_create as weak symbol and ld is satisfied. At execution time
13later rtld will resolve all these references to the strong symbols in the
14right thread library.
15
16Allowing the user to switch the threading lib works like this: At link
17time ld reads the SONAME of libpthread.so, which is set to libpthread.so.0
18(or a higher major, if ABI changes). Usually libfoo.so is a symlink to
19libfoo.so.3 which also has set its SONAME to libfoo.so.3, so that if
20libfoo.so.4 is being installed, programs will still continue to use
21libfoo.so.3 and not follow the symlink libfoo.so to the newer -- and
22possibly incompatible -- libfoo.so.4. What we do is approximately the
23opposite: libpthread.so is no symlink, but nevertheless has its SONAME
24set to libpthread.so.0. Now, however, libpthread.so.0 is a symlink to the
25threading library of your choice. The linker will use the default
26threading lib which libpthread.so is linked to, but the runtime linker
27will instead follow the symlink.
28
29This (obviously) does not work for static linking.