Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Feb 2000 20:24:56 -0700
From:      "Russell L. Carter" <rcarter@pinyon.org>
To:        Zhihui Zhang <zzhang@cs.binghamton.edu>
Cc:        freebsd-hackers@FreeBSD.ORG, rcarter@pinyon.org
Subject:   Re: FreeBSD Posix threads 
Message-ID:  <20000205032456.450F65B@pinyon.org>
In-Reply-To: Message from Zhihui Zhang <zzhang@cs.binghamton.edu>  of "Fri, 04 Feb 2000 12:25:17 EST." <Pine.GSO.3.96.1000204121232.25825C-100000@sol.cs.binghamton.edu> 

next in thread | previous 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.

Excellent questions.

However, what is not stated is perhaps the most important (to me,
and other people burning up and showering down $$$).  C++ programmers 
use threads to share class members.  In that context, the POSIX
realtime scheduling classes (SCHED_*) are quite useful, albeit abstractly
for now.

IMNSHO, focusing on fine-grained benchmarks ("perform better") for
an execution model based on C processes may be misleading in the 
realistic broader picture.

Russell


%-Zhihui
%
%
%
%
%To Unsubscribe: send mail to majordomo@FreeBSD.org
%with "unsubscribe freebsd-hackers" in the body of the message
%




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?20000205032456.450F65B>