From owner-freebsd-questions@FreeBSD.ORG Sun Aug 21 16:41:17 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 75B9F16A41F for ; Sun, 21 Aug 2005 16:41:17 +0000 (GMT) (envelope-from dmitry.mityugov@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0637943D45 for ; Sun, 21 Aug 2005 16:41:16 +0000 (GMT) (envelope-from dmitry.mityugov@gmail.com) Received: by wproxy.gmail.com with SMTP id i4so857705wra for ; Sun, 21 Aug 2005 09:41:16 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=e2ornVF+nJi6T1kpAK1pozl1vkVB6H0OR2fFFQrfy4bu+HDsafMGqlh94jGrCScpgo7q5XwfazX+rAvxUmYaUwXO948sVK9yslTrAVdXLM/1lkCeP9olBbc8gEXAZ/wZPAiWoVg+L78akTbAo0b7kgKLAN6cIz/ZCNS1mbNmOas= Received: by 10.54.6.50 with SMTP id 50mr1102575wrf; Sun, 21 Aug 2005 09:41:16 -0700 (PDT) Received: by 10.54.56.33 with HTTP; Sun, 21 Aug 2005 09:41:16 -0700 (PDT) Message-ID: Date: Sun, 21 Aug 2005 20:41:16 +0400 From: Dmitry Mityugov To: Garrett Cooper In-Reply-To: <430894AA.8060605@u.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050821123959.56599.qmail@web33304.mail.mud.yahoo.com> <430894AA.8060605@u.washington.edu> Cc: freebsd-questions@freebsd.org Subject: Re: polling decreases throughput ~50% X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2005 16:41:17 -0000 On 8/21/05, Garrett Cooper wrote: ... > Heh. We just discussed polling vs interrupts in an embedded systems > class this past quarter. Interrupts are better for more intermittent use > and polling is better for more frequent use, as polling is actually a > deadloop of course-for checking a flag most of the time-with potentially > a lot of wasted clock cycles before a context switch is made and the > task that was being polled for is run. Also, considering that actual > computer hardware isn't going to be running 100% of the time (except for > the CPU running idle tasks and stuff), interrupts are by far the better > way to go in general. But yeah... too many interrupts are bad as well... > Anyhow, that was sidetracking a bit :). Probably a good solution to this problem is to switch to the polling mode when you get an interrupt (or a few interrupts in a row), and switch back to the interrupt mode when the line has been idle for a while. --=20 Dmitry Mityugov, St. Petersburg, Russia I ignore all messages with confidentiality statements "We live less by imagination than despite it" - Rockwell Kent, "N by E"