From owner-freebsd-questions@freebsd.org Wed Jan 13 14:23:19 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A65C8A80115 for ; Wed, 13 Jan 2016 14:23:19 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD221C36 for ; Wed, 13 Jan 2016 14:23:18 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id u0DENFRc021048; Thu, 14 Jan 2016 01:23:15 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Thu, 14 Jan 2016 01:23:15 +1100 (EST) From: Ian Smith To: "darwinsurvivor@gmail.com" cc: kpneal@pobox.com, "William A. Mahaffey III" , freebsd-questions@freebsd.org Subject: Re: Task to busy one CPU 100% for a period of time? In-Reply-To: <20160114000637.U93547@sola.nimnet.asn.au> Message-ID: <20160114010606.X93547@sola.nimnet.asn.au> References: <20160111002439.Q93547@sola.nimnet.asn.au> <56928802.2040802@hiwaay.net> <20160111154616.G93547@sola.nimnet.asn.au> <20160111203832.GC88498@neutralgood.org> <20160113052558.R93547@sola.nimnet.asn.au> <20160114000637.U93547@sola.nimnet.asn.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 14:23:19 -0000 On Thu, 14 Jan 2016 00:57:58 +1100, Ian Smith wrote: > echo "`date` $me running $tasks load1 tasks for ${secs}s" > bgpids='' > done=0; trap "done=1; sleep=0" int quit term Oops, s/sleep/secs/ .. only added for extremely unlikely case one might hit ^C during starting up the load1 task/s, so untested. > while [ $done -eq 0 ]; do > while [ $tasks -gt 0 ]; do > ~/bin/load1 & > bgpids="$bgpids $!" > tasks=$((tasks-1)) > done > sleep $secs > done=1 > done And a missed tab .. too darn hot tonight :) cheers, Ian