From owner-freebsd-threads@FreeBSD.ORG Sat Jul 26 06:00:42 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 261E437B401 for ; Sat, 26 Jul 2003 06:00:42 -0700 (PDT) Received: from silver.he.iki.fi (silver.he.iki.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id E996B43FBD for ; Sat, 26 Jul 2003 06:00:40 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from PETEX31 (h81.vuokselantie10.fi [193.64.42.129]) by silver.he.iki.fi (8.12.9/8.11.4) with SMTP id h6QD0csL039914 for ; Sat, 26 Jul 2003 16:00:38 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <069c01c35375$e9352880$812a40c1@PETEX31> From: "Petri Helenius" To: Date: Sat, 26 Jul 2003 16:00:37 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: libkse "wieght" X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jul 2003 13:00:42 -0000 First of all, I´m very happy with the libkse since a few weeks ago, scheduling and signals seem to work for me and the application runs smoother than ever, although with only a handful of threads. I was wondering how "expensive" thread creation and termination designed to be with libkse, say should I just create and throw away tens or hundreds of threads in a small time or try to "recycle" the worker threads I already created? Most threads will be either waiting on network input/output,, condvar to flip or a sleep to expire. I would expect to have maximum of 5-10 threads executing at any time but I´m wondering if the traditional "large poll/select" approach is superior to creating, say, 500 threads? I´m not expecting you to design my app for me but just give insight of how expensive I should the thread maintenance and switching operations to be with libkse. By my previous experience with libkse, switching between threads is lightweight enough not to cause performance issues. I haven´t tested the creation/termination stuff yet. Pete