[lkml]   [2001]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Threads and the LDT (Intel-specific)?
    Scott Long <> writes:

    > I can also use the LDT to point to thread-specific segments. IMHO this
    > is much better than the stack trick used by linuxthreads. The problem

    Modern LinuxThreads (glibc 2.2) also uses modify_ldt for thread local data
    (much to the pain of the IA64 and x86-64 ports who have to emulate it..)

    > is, I don't fully understand how to use modify_ldt(). Is anyone
    > knowledgeable about this?

    modify_ldt() works like a memcpy to/from the ldt. See the man page. On the
    layout of the LDT see the intel IA32 architecture manual from

    > If anyone has any other suggestions, please let me know. If you are
    > confused as to why I would ever want to do this in the first place, I'd
    > be willing to go over it off the list.

    I can imagine, but it'll cost you. Most modern CPUs have heavy penalties for
    non-zero-based or limited segments (a few cycles for every memory access) and LDT
    switching also makes the context switch slower.

    An portable alternative is to use multiple processes with a shared memory area.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 12:55    [W:6.506 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site