Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Mar 2003 09:26:31 +0800
From:      "David Xu" <davidxu@freebsd.org>
To:        "Jeff Roberson" <jroberson@chesapeake.net>
Cc:        arch@freebsd.org
Subject:   Re: 1:1 threading.
Message-ID:  <006a01c2f3ff$e57cb300$f001a8c0@davidw2k>

next in thread | raw e-mail | index | archive | help
After reading your 1:1 threading code, I think you needn't
hack current KSE code to build your own 1:1 threading code.
Our code allow you to do this, actully, it's my earlier
idea to let 1:1 be implemented in our M:N code base, but never
had told this to julian or others.
if you want to create a thread, you can always call kse_create
syscall(the name should be changed to another, for example
upcall_create), the newly created upcall will be scheduled a
kernel thread on it and return to userland thread stack and
thread function, if you want to implement 1:1, you can always
set kse_mailbox.km_curthread to NULL, this ensures that userland
stack always has fixed association with kernel thread stack,
for me, 1:1 only means userland stack has fixed association with
kernel thread stack, no more. however, code in kse_create should be
adjusted to allow NUPCALLS > NCPUS, this allows 1:1 mode to be
implemented. thr_exit can be implemented to use kse_exit, and maybe
a wrapper to for kse_exit.
For thr_kill, I think we may add an API to allow a kernel
thread be identified by using kse_mailbox pointer or something
similar.
By implementing 1:1 code in current M:N code base, benifit is very
clear, a ksegrp protects time quantum and threads priority, and if
you want to implement a system scope thread(I know pthread has this
requirement), just call kse_create with newgroup parameters is 1,
you will immediately get a system scope thread.
Yes, you may think that KSE progress is slow, but I'd like to think
harder before pushing some not well thinked code into kernel.
At least, when I am thinking about M:N, I am also thinking about
1:1, I guess some people like 1:1, and others like M:N, so more choise =
is good.

David Xu

----- Original Message -----=20
From: "Jeff Roberson" <jroberson@chesapeake.net>
To: <kse@elischer.org>
Sent: Wednesday, March 26, 2003 11:00 AM
Subject: 1:1 threading.


> I just sent a mail to arch@ about a parallel effort that you all may =
be
> interested in.  Please follow up there.
>=20
> Thanks,
> Jeff



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?006a01c2f3ff$e57cb300$f001a8c0>