Date: Fri, 28 Sep 2001 08:14:25 -0400 (EDT) From: Daniel Eischen <eischen@vigrid.com> To: Julian Elischer <julian@elischer.org> Cc: arch@FreeBSD.ORG Subject: Re: KSE next steps... Message-ID: <Pine.SUN.3.91.1010928080509.29490C-100000@pcnet1.pcnet.com> In-Reply-To: <3BB4259D.4AF78B4@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 28 Sep 2001, Julian Elischer wrote:
> > c) define the user interface so that userland code can start to be planned.
> Here are some ideas..
> these are up for discussion....
>
> /* embed this in the Userland thread info */
> struct kt_context {
> struct kt_context *ktc_next_completed;
> mcontext_t ktc_ctx;
> void *ktc_UTS_private;
> unsigned int ktc_return_info;
> };
>
> /* Need one of these per KSE. */
> struct ks_mailbox {
> struct kt_context *ksm_curthread;
> struct kt_context *ksm_completed; /* runnable threads */
> unsigned int ksm_upcall_reason;
> /* probably some info for delivering signals */
> }
We need a way for the UTS to specify whether the KSE is in a critical
region don't we? I imagine having a word in the mailbox that when
non-zero the kernel will not make another upcall to this KSE. Or
are we using the stack pointer to tell if the UTS is currently in
a KSE upcall? If the latter, perhaps it is better to explicitly pass
the stack (possibly along with the ucontext_t) into the KSE creation
so that the kernel knows exactly what the stack limits are.
> possible syscalls....
>
> int new_kse(struct ks_mailbox *mbox, int new_group); /* add a new KSE */
> /* maybe in a new kse group */
>
> int yield_kse(struct timespec *sleeptime); /* don't come back till */
> /* time passed or work to do. */
>
> int wake_kse(struct ks_mailbox *mbx); /* if we specify a yielded KSE *
> /* both will return. NULL wakes any. */
>
> void exit_kse(); /* Will not return, but */
> /* writes completion code in mailbox. */
>
> int abort_thread(struct kt_context *ktc); /* if we find a thread in */
> /* this process that has this ktc, */
> /* then if it is sleeping, abort the syscall */
> /* if it is running, let it continue but set */
> /* flag so that if it tries to sleep, it aborts */
> /* instead */
>
> maybe reversing the sycall names...
> kse_new(), kse_yield(), kse_wake(), kse_exit(), thread_abort()
Yes, please :-) And rename thread_abort to kse_thread_abort,
kse_thread_interrupt, or kse_thread_kill.
--
Dan Eischen
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?Pine.SUN.3.91.1010928080509.29490C-100000>
