Re: thread-local storage, especially on x86
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com The Darwin kernel offers a function - thread_set_user_ldt() - which allows user-level code to set up a segment selector which can be loaded into %fs and used to address a specified address range. (The name of this function may be a little misleading, since it seems that that segment descriptor is shared by all threads in the calling process.) Comments prefacing that function suggest the possibility (if I understand correctly) of allocating and maintaing this selector on a per-thread basis; it's much easier for me to imagine that behavior being useful than it is for me to imagine a use for the current behavior. Alexei _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Sep 11, 2005, at 10:35 AM, Gary Byers wrote: thread_set_user_ldt is per-thread, not per-process. The kernel re- uses the same selector for multiple threads, but changes the segment descriptors in the LDT during a context switch. Each thread gets its own area. Note that the thread_set_user_ldt kernel function and it's Mach trap userspace equivalent are not part of the Mac OS X or Darwin supported API, and may change from release to release. This email sent to site_archiver@lists.apple.com
participants (1)
-
Alexei Kosut