Date: Fri, 4 Feb 2000 12:25:17 -0500 (EST) From: Zhihui Zhang <zzhang@cs.binghamton.edu> To: freebsd-hackers@freebsd.org Subject: FreeBSD Posix threads Message-ID: <Pine.GSO.3.96.1000204121232.25825C-100000@sol.cs.binghamton.edu>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.3.96.1000204121232.25825C-100000>