At 00:11 06-08-99 +0700, you wrote:
>On Thu, Aug 05, 1999 at 10:39:52PM -0600, steven haryanto wrote:
>coba diset ke SCHED_FIFO, terus nice diset ke nilai di bawah 0...
>terus SCHED_FIFO setau saya ngga bisa menjamin i/o, jadi kalau
>mpg123 ngga dapat data, ya musiknya tetep putus2... :)

thx. tetep ngga bisa euy, ngatur supaya mpg123 ngga putus2...
sori, ini saya attach prog setprio, kali aja saya ngode-nya
salah... mohon ditinjau :)

yang saya lakukan: jalanin mpg123 di console 1, setprio proses-nya
dengan setprio <pid> SCHED_FIFO 10 (saya coba juga 90), lalu mpg123 
di-nice ke -10. jalanin mc di console 3, buka .tar sekitar 300M 
(heavy IO :) ). ngga sukses juga, meski mc di-nice ke 20. proporsi
%CPU dilihat dari top kurang lebih sama aja dengan dan tanpa 
nice/setprio.

=====
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>

struct sched_param *sp;
int pid;
int pol;
int res;

main(argc,argv)
int argc;
char *argv[];
{
        sp=(struct sched_param *)malloc(sizeof(struct sched_param));
        
        if (geteuid())
        {
                printf("Sorry, you have to be root to run this program.\n");
                exit(1);
        }

        if (argc != 4)
        {
                printf("Usage: %s pid policy priority\n", argv[0]);
                exit(0);
        }

        pid=atoi(argv[1]);
        sp->sched_priority=atoi(argv[3]);

        if (strcasecmp(argv[2], "SCHED_OTHER") == 0)
        { pol=SCHED_OTHER; }
        else if (strcasecmp(argv[2], "SCHED_FIFO") == 0)
        { pol=SCHED_FIFO; }
        else if (strcasecmp(argv[2], "SCHED_RR") == 0)
        { pol=SCHED_RR; }
        else 
        { pol=atoi(argv[2]); }
        
        if((res=sched_setscheduler(pid, pol, sp)) == -1)
        {
                printf("Error: %s\n", strerror(errno));
                exit(1);
        }
}
=====

--sh


--------------------------------------------------------------------------------
Utk berhenti langganan, kirim email ke [EMAIL PROTECTED]
Informasi arsip di http://www.linux.or.id/milis.php3
Pengelola dapat dihubungi lewat [EMAIL PROTECTED]
Hosted by http://www.Indoglobal.com

Kirim email ke