Date: Wed, 03 Nov 1999 08:28:15 -0700 (PST) From: John Polstra <jdp@polstra.com> To: Nate Williams <nate@mt.sri.com> Cc: arch@freebsd.org Subject: Re: Threads models and FreeBSD. (Next Step) Message-ID: <XFMail.991103082815.jdp@polstra.com> In-Reply-To: <199911031503.IAA08453@mt.sri.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Nate Williams wrote:
>>
>> 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.
>
> Correct, but right after that, they stated that instead of having to
> specially annotate critical sections with assembler labels, it could be
> picked up automatically with the use of a modified compiler/assembler.
It could be done that way, but it doesn't need to be.
> Also, either way requires that the program be written in C/C++,
> which is unacceptable to me (and you I suspect), since some of my
> 'threaded' programs won't be written in C (Java) and you (Modula-3).
> These 'critical sections' will exist in Java, and I don't want to
> re-write the JVM to go figure out what sections are critical and
> have it build assembly versions.
No, they say "each critical section in the C source code -->>> for
the user-level thread package <<<--". They don't do anything special
to application programs. They only mess with the threads kernel
(src/lib/libc_r/uthread/uthread_kern.c) itself.
It boils down to surrounding certain small sections of code in
libc_r with
__pthread_begin_critical();
[...]
__pthread_end_critical();
(Pick your favorite name for the macros.)
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.991103082815.jdp>
