Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Oct 98 15:26:50 -0600
From:      "Richard Seaman, Jr." <lists@tar.com>
To:        "John Birrell" <jb@cimlogic.com.au>
Cc:        "current@freebsd.org" <current@FreeBSD.ORG>
Subject:   Re: Kernel threading (was Re: Thread Scheduler bug)
Message-ID:  <199810312126.PAA23692@ns.tar.com>

next in thread | raw e-mail | index | archive | help
On Sun, 1 Nov 1998 07:43:04 +1100 (EST), John Birrell wrote:

>Richard Seaman, Jr. wrote:

>Kernel threads should use libpthread and libc, not libc_r.

Agreed, sort of.  I don't use libc_r.  If you're going to implement
deferred cancellation points, I think you still need to wrap some
syscalls, so you still need to generate a separate libc somewhere.
The "kernel" syscalls drop into libpthread, in a manner analagous
to what happens in libc_r, but the wrappers are different, and the
syscalls that are wrapped are different.

>You can't mix
>kernel thread syscalls with user-thread syscalls because the styles are
>incompatible (blocking vs non-blocking).

Agreed.  A pure kernel thread implementation seems much simpler because
you just get rid of all the syscall wrapping that's needed to implement
user thread blocking i/o.  Or, am I missing something?

>You can't mix kernel thread
>scheduling with user-thread scheduling.

Agreed.  In kernel threads the kernel scheduler does all the work.
You can get rid of all the 19 pages of user thread scheduling code.

>It doesn't sound like you have
>made any attempt to update the user-space knowledge of the running thread.
>As a result you will mix all errno codes and all user-space locking. This
>is a fundamental issue that needs to be designed, not hacked.

Well, the user-space knowledge of the running thread comes from pthread_self,
which in the case I've implemented this comes from the code John Dyson
provided to the list a while back.  errno codes are returned on the
thread stack, if I understand his code.




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?199810312126.PAA23692>