From owner-freebsd-arch Fri Sep 28 5:15:29 2001 Delivered-To: freebsd-arch@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 0DBB437B40C for ; Fri, 28 Sep 2001 05:15:26 -0700 (PDT) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id IAA03656; Fri, 28 Sep 2001 08:14:26 -0400 (EDT) Date: Fri, 28 Sep 2001 08:14:25 -0400 (EDT) From: Daniel Eischen To: Julian Elischer Cc: arch@FreeBSD.ORG Subject: Re: KSE next steps... In-Reply-To: <3BB4259D.4AF78B4@elischer.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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