Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jun 2005 19:16:04 -0500
From:      "Matthew D. Fuller" <fullermd@over-yonder.net>
To:        Mike Hunter <mhunter@ack.berkeley.edu>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Slowing down an old program to run on a fast CPU?
Message-ID:  <20050611001604.GB93862@over-yonder.net>
In-Reply-To: <20050610224415.GB11336@malcolm.berkeley.edu>
References:  <20050610224415.GB11336@malcolm.berkeley.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 10, 2005 at 03:44:15PM -0700 I heard the voice of
Mike Hunter, and lo! it spake thus:
> 
> Is there a general-purpose approach to this kind of problem in the
> FBSD world?  I can see myself writing a C program called `slow` that
> would take argv[1] as the factor ( > 1) by which argv[2] should be
> slowed down by.

It'd be tough.  One way might be a wrapper program that SIGSTOP'd and
SIGCONT'd the program with some pauses, but that would be incredibly
nasty and probably not too pretty.  A better way could would be to
wrap the program with a library implementing sleep() and friends
differently, so they pause for N times as long.  But even that doesn't
help when the programs don't slow themselves down.

I guess the only general solution would be an API into the scheduler
saying "Don't give this program more than N% of the CPU", but I'm
pretty sure we don't have one.  It'd be neat, though...
/usr/bin/too-nice-for-its-own-good    8-}


-- 
Matthew Fuller     (MF4839)   |  fullermd@over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050611001604.GB93862>