From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 17 09:56:49 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9554516A4BF for ; Wed, 17 Sep 2003 09:56:49 -0700 (PDT) Received: from fever.boogie.com (cpe-66-87-52-132.co.sprintbbd.net [66.87.52.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30DCE43FD7 for ; Wed, 17 Sep 2003 09:56:48 -0700 (PDT) (envelope-from durian@boogie.com) Received: from man.boogie.com (man.boogie.com [192.168.1.3]) by fever.boogie.com (8.12.9/8.12.9) with ESMTP id h8HGukLF008182; Wed, 17 Sep 2003 10:56:47 -0600 (MDT) (envelope-from durian@boogie.com) From: Mike Durian To: hackers@freebsd.org Date: Wed, 17 Sep 2003 10:56:45 -0600 User-Agent: KMail/1.5.3 References: <200309161647.38197.durian@boogie.com> <3F68055D.E1094799@mindspring.com> In-Reply-To: <3F68055D.E1094799@mindspring.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309171056.46004.durian@boogie.com> Subject: Re: tty layer and lbolt sleeps X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2003 16:56:49 -0000 On Wednesday 17 September 2003 12:55 am, Terry Lambert wrote: > > You need your process to become a process group leader, and then > you need the serial port you are interested in to become the > controlling tty for your process. I thought daemon(3) and TIOCSCTTY would do the trick, however after a few tests, I still see the timing problems. This whole process seems like a lot of work just to get decent responsiveness from a serial port. After all, I don't really want to change the controlling terminal. Can anyone explain the rational behind the ttybg1 and ttybg2 sleeps in the tty.c code? Are they really necessary? What sort of horrible things would happen if I removed those clauses? If I am reading things correctly, they've been in the tty.c source code since the initial check-in. Or maybe I'm on a wild goose chase here. Maybe my read and drain delays which seem to be correlated to HZ are really caused by something else. An lbolt sleep just seems like a likely cause to me. mike