From: <va...@li...> - 2007-07-30 11:37:58
|
> Is there a reason that thet tld functions are marked for deletion?? Yes. In fact, thanks for reminding me! > We need functions that can give threads access to their own > version of global type variables. > ... > In the past, I've included the define USE_SYLLABLE_THREADS, however, I > intend to change that to SYLLABLE_USE_TLS or possibley SYLLABLE_USE_TLD.? > I plan to take advantage of the same implementation that GLX uses.? So, if > the tld.h functions are marked for deletion, please hold off on that.? Or > let me know if they are broken & need to be fixed or maybe the API isn't > so good.? Which ever the case is, thanks in advance! This is a bit of a complex story, but bear with me: When I forked from AtheOS I had the latest source from the atheos.cx CVS repository and the latest source tarballs for Glibc. It turned out the Glibc source was not quite as upto date as the binaries, so a few things were missing: like the set_tld() & get_tld() functions. If you go back to the early syllable-developer archives you'll see my epic battle to get it to compile. At one point I thought the set_tld() & get_tld() functions were missing and needed to be added as syscalls, so I did. Then I realised they didn't need to be syscalls at all, so I moved them into Glibc and marked the old syscall functions in process.c as deprecated. They havn't been used since 0.4.1, if I remember correctly. The implementation in Glibc is complete (& indeed, has been extended when I ported Glibc 2.3, with the addition of get_tld_addr()) So TLD is safe to use. Glibc even relies on it in several places E.g. for thread-safe errno. Now TLS support is something different, and is not implemented in Syllable. Bug #228 is open to track any work on it. TLS is a GNU ELF extension that is more flexible than TLD. With TLS you can use the __thread qualifier to mark a variable as thread-local, and the system takes care of the rest. There is no mucking about with TLD handles and implicit getting & setting the contents. GNU TLS support is now required by Glibc since release 2.4, but we can just about get away without it for now because it isn't used too heavily, and they can mostly be patches around: one exception is the DNS resolver, which is why we also have bug #229: there is no easy way to patch out the use of TLS so we have to live with it for now. ABrowse actually uses a different resolver library currently to avoid this bug. So there we go: the story of TLD & TLS on Syllable so far. Patches to implement GNU TLS would be more than gladly accepted, by the way! -- Vanders (In a WebCafe, in Glasgow) http://www.syllable.org http://www.liqwyd.com |