lkml.org 
[lkml]   [2001]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Threads and the LDT (Intel-specific)?
From
Date
Scott Long <smlong@teleport.com> 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 http://developer.intel.com

> 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.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:55    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog