Moving ThreadWeaver to kdelibs

Thiago Macieira thiago at kde.org
Tue Sep 13 20:37:52 BST 2005


Mirko Boehm wrote:
>What is wrong with a static library that is available before kdecore is
>compiled (really, this is a question).

You can't link a dynamic library to a static library directly.

By definition, a static library is code that is inserted into your 
program's final binary. If we do that to libkdecore, that means the code 
is inserted into the final library and would, thus, be available for 
anyone linking to libkdecore. That's what a "convenience library" is and 
how libkdecorenetwork is actually built.

The other solution is to drop the linking, remove the -no-undefined from 
libkdecore and let libtool do the linking. It would add a notice to 
libkdecore.la saying that each and every program that links to libkdecore 
must link to the static library as well, and be -rdynamic (that is, allow 
libkdecore to find symbols upstream into the program binary).

I really dislike the second option. Therefore, if libThreadWeaver is a 
static library and libkdecore uses it, it should be a convenience 
library. In order to avoid other people using it without being allowed 
to, we could simply use hidden visibility and/or a special namespace.

That's what I had proposed in another email earlier today.

By the way, the whole reason I want to use ThreadWaver is that 
KNetwork::KResolver starts up to 5 threads to do its job. QtNetwork's 
QHostInfo does something similar, but starts only 1 thread. Each 
name-resolution in KDE is actually 2 threads so that IPv6 and IPv4 are 
done simultaneously instead of sequentially (like QHostInfo). So, for 
instance, when Kopete starts connecting 2 accounts, it could take up to a 
fourth of the time of QHostInfo takes. Maybe those times are negligible, 
maybe not.

The drawback is that the union of the IPv4 and IPv6 getaddrinfo(3) results 
are not the same as the "any" getaddrinfo(3) results (I view that a bug 
in the getaddrinfo/glibc/libnss implementation).

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

3. Ac seo woruld wearð geborod, swá se Scieppend cwæð "Gewurde Unix" and 
wundor fremede and him "Unix" genemned, þæt is se rihtendgesamnung.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050913/3cbac9cd/attachment.sig>


More information about the kde-core-devel mailing list