Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Nov 1998 09:16:11 -0000 
From:      James Mansion <james@westongold.com>
To:        Julian Elischer <julian@whistle.com>, Daniel Eischen <eischen@vigrid.com>
Cc:        James Mansion <james@westongold.com>, peter@netplex.com.au, current@FreeBSD.ORG, jb@cimlogic.com.au, lists@tar.com
Subject:   RE: Kernel threading (was Re: Thread Scheduler bug)
Message-ID:  <32BABEF63EAED111B2C5204C4F4F50201807@WGP01>

next in thread | raw e-mail | index | archive | help
Hmm - why does the page need to be 'swapped out'?  Can't it
just be swapped into another part of the processes' existing
space by frigging the mapping when the thread becomes scheduled?

After all, each (user land) thread already has a stack area
malloced or otherwise mapped into the address space.

If you would rather just have a single pointer that's changed
on a schedule, and the pointer has a well-known address, then
fine.

My understanding is that on some systems the thread's private
data is accessed via value stored in a reserved register.  I
think that would be a mistake on an x86 where the number of
registers is quite small, unless one of the segment base
registers could be reserved without stuffing compilers, ABIs
etc.

Thread rescheduling should happen relatively infrequently
compared to access to the thread-specific data.

(I'm only here because I'm trying to guage whether it is worth
trying to support FreeBSD as a reference SMP/threaded platform,
so I'll not pretend any kernel (or ABI, or ...) expertise.  I
just need pthread_*, aio_*, and lio_* to work as advertised and
be fast.  Oh, and thread-safe STL and exception handling.)

James

> -----Original Message-----
> From: Julian Elischer [mailto:julian@whistle.com]
>... 
> if you make the threads have differnt pages, then either the 
> addres space
> needs to be 'munged' on each reschedule (where is the page 
> swapped out to
> since where it's swapped to depends on the object mapped into 
> the address
> space), or you need to have multiple different address spaces
> sharing a lot of 'objects' which is a lot less efficient.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32BABEF63EAED111B2C5204C4F4F50201807>