From owner-freebsd-hackers Sun Dec 19 14:38:43 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from monkeys.com (i180.value.net [206.14.136.180]) by hub.freebsd.org (Postfix) with ESMTP id 2FE6C14DA5 for ; Sun, 19 Dec 1999 14:38:29 -0800 (PST) (envelope-from rfg@monkeys.com) Received: from monkeys.com (localhost [127.0.0.1]) by monkeys.com (8.9.3/8.9.3) with ESMTP id OAA48479 for ; Sun, 19 Dec 1999 14:38:28 -0800 (PST) To: hackers@FreeBSD.ORG Subject: Re: Practical limit for number of TCP connections? In-reply-to: Your message of Sun, 19 Dec 1999 13:39:18 -0800. <199912192139.NAA09232@apollo.backplane.com> Date: Sun, 19 Dec 1999 14:38:28 -0800 Message-ID: <48477.945643108@monkeys.com> From: "Ronald F. Guilmette" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <199912192139.NAA09232@apollo.backplane.com>, Matthew Dillon wrote: >:I'd like to just take a second and re-express my growing confusion on >:this whole topic. >: >:Why do you say that this complete-process-blocking effect only takes >:place in the case of disk reads?? Isn't a read a read? What difference >:does it make what the device type being read from is? >: >:Is there some piece of code burried somewhere in either libc or the >:kernel that checks each call to read(2) to find out if that is a disk >:drive you are reading from versus reading from a terminal or a network >:socket? >: >:I'm just trying to understand this stuff. > > There are certain I/O related operations which are assumed to not > block, even though the kernel *might* block on the temporarily. > > For example, when you open and read() from a file, you assume your > read() command will return reasonably quickly... What do you mean by ``you'' in this context? > ... > However, things like disk I/O are assumed to not block... Assumed by what exactly? Thank you for the elaborate answer, but you didn't really address my question. Is there code somewhere, perhaps within the libc implementation of read(2) that looks to see what kind of device I am reading from, and then does two different things if the read is for a disk file versus a read for a terminal? If so, and if that code operates in userland (as opposed to being in the kernel), then to a certain extent that kinda shoots the hell out of the old UNIX transparency notion that ``a file is a file is a file''. I'm not complaining about that mind you. I'm just noting it, and the fact that (for me at least) it makes me just slightly uneasy for reasons I can't quite put into words. > The current threads implementation has this problem because you have N > threads running under a single process. If one thread blocks on a disk > I/O then all the threads essentially block. The proposed new > threads implementation does not have this problem. Good. I gather from your other comments that the new threads implementation will indeed return us to a state where ``a file is a file is a file'' and where no special handling of different _kinds_ of files takes place (or needs to take place) within, for example libc read(2). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message