From owner-freebsd-performance@FreeBSD.ORG Thu Oct 30 07:34:28 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCAD6106567A for ; Thu, 30 Oct 2008 07:34:28 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from mx.bulinfo.net (mx.bulinfo.net [193.194.156.1]) by mx1.freebsd.org (Postfix) with ESMTP id 916D08FC08 for ; Thu, 30 Oct 2008 07:34:28 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from localhost (localhost [127.0.0.1]) by mx.bulinfo.net (Postfix) with ESMTP id 988CCC988; Thu, 30 Oct 2008 09:34:26 +0200 (EET) Received: from mx.bulinfo.net ([127.0.0.1]) by localhost (mx.bulinfo.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03321-09; Thu, 30 Oct 2008 09:34:23 +0200 (EET) Received: from [192.168.2.188] (pythia.bulinfo.net [212.72.195.5]) by mx.bulinfo.net (Postfix) with ESMTP id DECD8C936; Thu, 30 Oct 2008 09:34:23 +0200 (EET) Message-ID: <4909637E.3030802@bulinfo.net> Date: Thu, 30 Oct 2008 09:34:22 +0200 From: Krassimir Slavchev User-Agent: Thunderbird 2.0.0.14 (X11/20080616) MIME-Version: 1.0 To: Jason Stone References: <49088124.9050809@bulinfo.net> In-Reply-To: X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at mx.bulinfo.net X-Mailman-Approved-At: Thu, 30 Oct 2008 11:22:16 +0000 Cc: freebsd-performance@freebsd.org Subject: Re: thread switching time? X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2008 07:34:28 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jason Stone wrote: > >> I am using FreeBSD 7 and would like to decrease the time of switching >> between threads. This time seems to be 1ms and it is impossible to >> make lower delays inside a thread, at least using nanosleep(). > >> Is it possible to decrease this time to 1us? > > Increase HZ, with the usual caveats about trading off latency for overhead? > > > -Jason > I have: kern.clockrate: { hz = 4000, tick = 250, profhz = 4000, stathz = 129 } but no difference. Yes, overheads are lower and my application's performance is better but thread switching time is same. AFAIR I have read somewhere on the Internet about such problem when playing multiple video files and the solution was to change some parameters somewhere in header files but I cannot find this again. Best Regards -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFJCWN+xJBWvpalMpkRAt+qAKCjoLVyUZdbf91nqrgSj0nOhiGOhQCfYaqv IijZrwPCRYJmBUGHb2WI9IA= =uv12 -----END PGP SIGNATURE-----