From owner-freebsd-hackers Mon Dec 27 10:31:20 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from luna.lyris.net (luna.shelby.com [207.90.155.6]) by hub.freebsd.org (Postfix) with ESMTP id 1EA3D14DF5 for ; Mon, 27 Dec 1999 10:31:18 -0800 (PST) (envelope-from kip@lyris.com) Received: from luna.shelby.com by luna.lyris.net (8.9.1b+Sun/SMI-SVR4) id KAA24969; Mon, 27 Dec 1999 10:30:54 -0800 (PST) Received: from (luna.shelby.com [207.90.155.6]) by luna.shelby.com with SMTP (MailShield v1.50); Mon, 27 Dec 1999 10:30:54 -0800 Date: Mon, 27 Dec 1999 10:30:54 -0800 (PST) From: Kip Macy To: "Richard Seaman, Jr." Cc: Steffen Merkel , freebsd-hackers@FreeBSD.ORG Subject: Re: Kernel threads In-Reply-To: <19991227120931.H5975@tar.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SMTP-HELO: luna X-SMTP-MAIL-FROM: kip@lyris.com X-SMTP-RCPT-TO: dick@tar.com,d_f0rce@gmx.de,freebsd-hackers@FreeBSD.ORG X-SMTP-PEER-INFO: luna.shelby.com [207.90.155.6] Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG They may be preemptive, but I saw a lot of instances with Lyris where one thread could easily monopolize processor time at the expense of all others and I had to add sleeps in at places. > > FreeBSD user threads have fairly high context switch overhead, especially > when there are open fds that get polled on each context switch. Kernel > threads are actually faster in many circumstances. Not Linux threads. The linux threads implementation, as parts of its synchronization methods, disables interrupts. When Lyris previously used one thread for each connection, performance on FreeBSD was 20-30x that of Linux, and solaris was 30-40x that of Linux. Some simple benchmarking by a friend of mine at Berkeley indicated that Java using native threads on Linux was about 100x slower than using green threads. So maybe FreeBSD kernel threads will be better, but working with Linux's kernel threads has only made me dislike Linux more than I did previously. -Kip To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message