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)   |  [EMAIL PROTECTED]
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to