Date: Tue, 2 Nov 1999 20:24:25 -0800 (PST) From: John Polstra <jdp@polstra.com> To: eischen@vigrid.com Cc: arch@freebsd.org Subject: Re: Threads models and FreeBSD. (Next Step) Message-ID: <199911030424.UAA47266@vashon.polstra.com> In-Reply-To: <381F85F2.BF6D5A2@vigrid.com> References: <Pine.BSF.4.10.9911020810090.2283-100000@current1.whistle.com> <381F78AF.D5073BFB@vigrid.com> <199911030016.RAA26726@mt.sri.com> <381F85F2.BF6D5A2@vigrid.com>
index | next in thread | previous in thread | raw e-mail
In article <381F85F2.BF6D5A2@vigrid.com>,
Daniel M. Eischen <eischen@vigrid.com> wrote:
> Nate Williams wrote:
> >
> > > For a thread bound to a LWP, you only notify the user level threads
> > > library if it blocks because it's time quantum expired (so the threads
> > > library can see if it is in a critical region).
> >
> > They talk about this in the paper, and I don't like their solution.
> > Having to modify the compiler/assembler and such is not a workable
> > solution, IMO.
>
> No, I didn't either, but you can still get the same thing by manually
> coding each routine. You could also set flags instead with not too
> much more overhead.
I've just been looking at the paper, and I don't think they modified
the compiler or the assembler. What they say is:
We do this by delimiting, with special assembler labels, each
critical section in the C source code for the user-level thread
package; we then post-process the compiler-generated assembly
code to make the copy.
I think the "delimiting, with special assembler labels" is simply
the addition of some asm statements to the C source code of their
libc_r threads kernel equivalent. The second part, "post-process
the compiler-generated assembly code," is just a little program or
shell/awk/sed/perl script and some fancy Makefile rules.
All they are aiming for is a table of PC ranges that they can consult
at run time to determine whether the thread was in a critical section
when it blocked or was pre-empted. That's easy to get without
modifying the compiler or assembler -- especially with ELF, where we
can put the table into a separate section.
John
--
John Polstra jdp@polstra.com
John D. Polstra & Co., Inc. Seattle, Washington USA
"No matter how cynical I get, I just can't keep up." -- Nora Ephron
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199911030424.UAA47266>
