From owner-freebsd-arch Sun Jan 14 6:44:20 2001 Delivered-To: freebsd-arch@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 80F1E37B401 for ; Sun, 14 Jan 2001 06:43:57 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f0EEhu902269 for arch@freebsd.org; Sun, 14 Jan 2001 06:43:56 -0800 (PST) Date: Sun, 14 Jan 2001 06:43:56 -0800 From: Alfred Perlstein To: arch@freebsd.org Subject: kthread_* api pretty rough Message-ID: <20010114064356.Q7240@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I was pretty excited to see that we're using kthread_ stuff, however actually using it is a bit more complex than I'd hoped. There's a couple of questions that I didn't see answered in the manpage: 1) how to actually start the thread? kern/kern_idle.c and kern/kern_intr.c both have somewhat different things that they fiddle with in the proc struct returned by kthread_create. 2) is simply calling kthread_exit(); enough to clean up the thread? 3) what are the state of the locks when the thread runs initially? what about what state they need to be in before calling kthread_exit()? 4) why we need to fiddle with the proc flags after starting a kthread instead of having kthread_create do it for us. 5) do i really want to be using kproc_start instead of kthread_create? I just want to run a couple of threads to do some microbenchmarks on some code I'm testing. 6) shouldn't the stuff to OR with the process flags be made into an arg to kthread_create? thanks, -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message