From owner-freebsd-threads@FreeBSD.ORG Tue Feb 10 17:53:17 2004 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 06EB416A4CE for ; Tue, 10 Feb 2004 17:53:17 -0800 (PST) Received: from bento.FreeBSD.org (bento.freebsd.org [216.136.204.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0131743D31; Tue, 10 Feb 2004 17:53:17 -0800 (PST) (envelope-from davidxu@viatech.com.cn) Received: from viatech.com.cn (localhost [127.0.0.1]) by bento.FreeBSD.org (8.12.10/8.12.10) with ESMTP id i1B1rEQt017260; Tue, 10 Feb 2004 17:53:15 -0800 (PST) (envelope-from davidxu@viatech.com.cn) Message-ID: <40298B15.1050409@viatech.com.cn> Date: Wed, 11 Feb 2004 09:53:25 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dung Patrick References: <1076463104.c8c39f40dkt@digitalme.com> In-Reply-To: <1076463104.c8c39f40dkt@digitalme.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Question about threads [beaver challenge] 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: Wed, 11 Feb 2004 01:53:17 -0000 Dung Patrick wrote: >Would you please explain this parameter: > >kern.threads.max_groups_per_proc > It is used by system scope thread in libpthread, whenever you create a system scope thread, kernel creates a dedicated thread for the user thread, it also eats a kernel thread group, for programs heavily use system scope thread, the sysctl value should be increased. current kern.threads.max_threads_per_proc not only accounts process scope thread which are being blocked in kernel, but also accounts system scope thread, so you should increase the sysctl value at same time, otherwise too much system scope threads can block process scope thread because the thread limit is hit and no upcall will be scheduled, so UTS does not have chance to run, if UTS can not run, then process scope thread can not be scheduled in userland, result is process is suddenly stopped. The default values are too low for some applications. we might increase it before 5.3 release. David Xu