From owner-freebsd-hackers Fri Jan 8 15:18:23 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA09659 for freebsd-hackers-outgoing; Fri, 8 Jan 1999 15:18:23 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA09654 for ; Fri, 8 Jan 1999 15:18:21 -0800 (PST) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id QAA21727; Fri, 8 Jan 1999 16:17:44 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp04.primenet.com, id smtpd021543; Fri Jan 8 16:17:30 1999 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id QAA19479; Fri, 8 Jan 1999 16:17:16 -0700 (MST) From: Terry Lambert Message-Id: <199901082317.QAA19479@usr05.primenet.com> Subject: Re: pthreads question/problem... To: dot@dotat.at (Tony Finch) Date: Fri, 8 Jan 1999 23:17:15 +0000 (GMT) Cc: hackers@FreeBSD.ORG In-Reply-To: <13973.60376.9845.729115@chiark.greenend.org.uk> from "Tony Finch" at Jan 8, 99 11:28:24 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > Sometimes you want M to be large relative to the number of CPUs > > > because you are using threading to improve userland IO concurrency. > > > > Finish the thought: > > > > "...and you don't want to use async I/O to improve I/O > > concurrency because, while doing so would be less overhead > > than using a bunch of threads, it doesn't accomplish > > your *real* goal." > > The other reason for not using aio is because the aio calls do not > cover the whole range of system calls that block (open, close, stat, > unlink, etc...). I don't see how you can fix that without either using > some sort of fork or adding stuff to the API. Actually, that's the reason for implementing the POSIX AIO calls as library entry points that make use of async call gates, instead of jamming the things into the poor kernel's overstuffed bowels... the POSIX AIO interface only applies to a subset of calls, and thus is pretty frigging useless. The whole migration to kernel threads has been ill-thought out. From what I can tell so far, the reasoning is so that we can use a precompiled version of glibc.so that makes Linux system calls, instead of compiling our own version of glibc.so that Linux programs use, and which has entry points for the Linux system calls that wrap what are actually FreeBSD system calls instead. The disadvantage of this, of course, is that you need less Linux emulator code in the kernel... (that was me being facaetious). This is a general case of kernel bloat. There's really no topological difference between call conversion threads that can be signal preempted by a user space scheduler, and Linux kernel threads that are preempted by the kernel scheduler. The only real difference is SMP scalability (which isn't resolved in the least by Linux kernel threaded applications that have any technical reason to be implemented as threaded instead of as seperate processes), and that requires user space cooperation and a lot of scheduler work unrelated to Linux kernel threads. Put another way, changing the saving the registers and changing the stack and the program counter is the same whether it occur in user or kernel space; why people make such a big deal about where this happens is really beyond me; it has to be related to their misunderstanding of rfunctional decomposition a part of the problem solving process.... It seems to me that this is nothing more than additional kernel bloat whose sole purpose is to enable FreeBSD to run Linux code that depends on static linking or unrecompiled Linux shared libraries, which is of dubious value at best. >From that perspective, it would be a hell of a lot more valuable to do Solaris kernel threads emulation, and get 1000 times as many applications (including a JAVA, a JDK, an a SWING and AWT implementation that doesn't require paying Sun $500,000 (or whatever) to actually use in real life). You could also approach Solaris the same way: provide a FreeBSD system call calling version of a libc.so that looks like Solaris binaries expect it to look. The additional advantage of this is that you would no longer need a Solaris license to run Solaris binaries on FreeBSD (which is a good reason to install Solaris instead of FreeBSD,since you're paying for Solaris anyway). Even better would be to replace the FreeBSD manifest constants, as necessary, to bring the FreeBSD ABI into line with the Solaris ABI, so that code will "just run". The only real remaining question is whether I namelist and document the Solaris libraries, and someone else implements them, or vice versa (I'd prefer vice versa, since then "someone else" can be in Germany and thus beyond any legal reproach, and implementation could use help and scales to more people more easily...). The manifest constants in the headers are, of course, published, regardless of what the license claims, at least for anyone in the jurisdiction of the US 5th circuit court of appeals. Since that doesn't stop them from suing, it would be nice if a German could look at documenting them, too. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message