All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Scott Long <smlong@teleport.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Threads and the LDT (Intel-specific)?
Date: 13 Jun 2001 11:15:53 +0200	[thread overview]
Message-ID: <ouplmmwloza.fsf@pigdrop.muc.suse.de> (raw)
In-Reply-To: <01061011532900.01126@abacus.suse.lists.linux.kernel>
In-Reply-To: Scott Long's message of "10 Jun 2001 20:59:15 +0200"

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

       reply	other threads:[~2001-06-13  9:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <01061011532900.01126@abacus.suse.lists.linux.kernel>
2001-06-13  9:15 ` Andi Kleen [this message]
2001-06-10 18:53 Threads and the LDT (Intel-specific)? Scott Long
2001-06-10 18:40 ` Jeff Dike

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ouplmmwloza.fsf@pigdrop.muc.suse.de \
    --to=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=smlong@teleport.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.