From owner-freebsd-hackers Sat Apr 25 23:33:00 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA27651 for freebsd-hackers-outgoing; Sat, 25 Apr 1998 23:33:00 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp03.primenet.com (daemon@smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA27641 for ; Sat, 25 Apr 1998 23:32:57 -0700 (PDT) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id XAA02219; Sat, 25 Apr 1998 23:32:55 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp03.primenet.com, id smtpd002205; Sat Apr 25 23:32:52 1998 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id XAA28042; Sat, 25 Apr 1998 23:32:45 -0700 (MST) From: Terry Lambert Message-Id: <199804260632.XAA28042@usr05.primenet.com> Subject: Re: threads performance To: jasone@canonware.com (Jason Evans) Date: Sun, 26 Apr 1998 06:32:44 +0000 (GMT) Cc: toor@dyson.iquest.net, toshok@Hungry.COM, freebsd-hackers@FreeBSD.ORG In-Reply-To: from "Jason Evans" at Apr 25, 98 02:48:57 pm 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 > Threads performance is also very important to SQRL (the Hungry DBMS), so See other post. The performance seen is probably a use model problem. > I'm very interested in how the pthreads library that uses clone() will be > architected. Specifically, will we be doing the same as LinuxThreads > does, with a 1:1 mapping of threads to kernel "processes"? I tend to > think that a multi-level threading scheme, such as what Solaris uses, has > the potential for better scalable performance. Solaris (and SVR4.2 derived) kernel threading is arguably Very Broken for most of their recommended use models. Specifically, the use models are subject to thread quantum starvation, even in the face of available process quantum going unused. The only use model where this isn't the case is the one-thread spawn ahead with autothread creation when there are runnable user space threads and all kernel threads but the one that does the spawning are currently busy with blocking calls. Ultimately, the only fix is a cooperative user space scheduler. AIO helps a lot, but there are blocking calls that are not dealing with vanilla fd's. Ultimately, the fix for this would be an async call gate for all system calls, and per system call falgging about whether the call is non-blocking, potentially blocking, or definitely blocking, and the addition of a call context management interface (cancel, wait, etc.). Probably you would want to build POSIX AIO on top of the async call gate, rather than adding async versions of existing calls, and missing the blocking calls that POSIX misses because they expect the problem to be I/O blocking and concurrency. But enough about Solaris/SVR4.2. 8-). > It's also a good bit > harder to write such a library. =( We'd also need to understand the > performance problems with our current user-land threads library to make > multi-level threads work well. The general problem with a user space threads library is starvation of threads in the case of a CPU intensive thread not calling explicit thread_yield() when it fails to call system calls to implicitly yield. 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