lab7/code/sched.c
/* Read the list of process to be executed from stdin */
Read the list of process to be executed from stdin
Read the list of process to be executed from stdin
void load_task() {
	int num_proc = 0;
	scanf("%d %d\n", &timeslot, &num_proc);
	for (int i = 0; i < num_proc; ++i) {
		pcb_t * proc = (pcb_t*)malloc(sizeof(pcb_t));
		proc->pid = i;
		scanf("%d %d\n", &proc->arrival_time, &proc->burst_time);
		en_queue(&in_queue, proc);
	}
}
void load_task ( ) { int num_proc = 0 ; scanf ( " \n " , & timeslot , & num_proc ) ; for ( int i = 0 ; i < num_proc ; ++ i ) { pcb_t * proc = ( pcb_t * ) malloc ( sizeof ( pcb_t ) ) ; proc -> pid = i ; scanf ( " \n " , & proc -> arrival_time , & proc -> burst_time ) ; en_queue ( & in_queue , proc ) ; } }
Read the list of process to be executed from stdin
Read the list of process to be executed from stdin