Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jun 2003 15:40:48 +0400 (MSD)
From:      Igor Sysoev <is@rambler-co.ru>
To:        threads@freebsd.org
Subject:   Implementing TLS: step 1
Message-ID:  <Pine.BSF.4.21.0306201539530.25447-100000@is>

next in thread | raw e-mail | index | archive | help
If we could sacrifice our current thread compatibility in 5.0-5.1
then we could change kse_mailbox from

        struct kse_mailbox {
           int                     km_version;     /* Mailbox version */
           struct kse_thr_mailbox  *km_curthread;  /* Current thread */
           ...

to
     
        struct kse_mailbox { 
           struct kse_thr_mailbox  *km_curthread;  /* Current thread */
           int                     km_version;     /* Mailbox version */
           ...

then x86's gs would still point to kse_mailbox, and gs:[0] would be
and TP pointer.  Also we need to modify

     struct kse_thr_mailbox {
+          void              *tls;
           ucontext_t        tm_context;     /* User thread context */
           ...

And the static TLS must be allocated before kse_thr_mailbox.


Igor Sysoev
http://sysoev.ru/en/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0306201539530.25447-100000>