From owner-freebsd-hackers Fri Feb 4 19: 3:56 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by builder.freebsd.org (Postfix) with ESMTP id 85AC244D1 for ; Fri, 4 Feb 2000 19:03:52 -0800 (PST) Received: from sol.cs.binghamton.edu (cs1-gw.cs.binghamton.edu [128.226.171.72]) by bingnet2.cc.binghamton.edu (8.9.3/8.9.3) with SMTP id NAA09753 for ; Fri, 4 Feb 2000 13:39:53 -0500 (EST) Date: Fri, 4 Feb 2000 12:25:17 -0500 (EST) From: Zhihui Zhang To: freebsd-hackers@freebsd.org Subject: FreeBSD Posix threads Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I have searched the archive for a while and still have some confusions about this subjects: (1) Some people say "For I/O bound activity, kernel threads are a really bad idea". But I read the following passage from else where: Kernel threads perform better in I/O-intensive applications because system call can be blocking for kernel threads (so there is only one user-to-kernel and kernel-to-user transition per I/O operation rather than two). So which one is the correct answer? I know there is only userland thread in FreeBSD, but I would like to know the answer. (2) User threads are supposed to be faster than kernel threads in context switch. But since we poll devices during each context switch, it is actually slower (poll() is the extra system call). Is this correct? (3) Can I do cooperative thread scheduling on FreeBSD? I guess the constant SCHED_RR (round robin) means preemptive. How about SCHED_FIFO and SCHED_OTHER defined in posix4/sched.h? Can I choose from them? In the case of SCHED_RR, I still do part of scheduling by routines like yield(), cond_signal(). Am I right? Any help is appreciated. -Zhihui To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message