Beispiel #1
0
int main(int argc, char **argv)
{
	message_init();
	
	lift_pid = fork();
	if(!lift_pid) {
		lift_process();
	}
	liftmove_pid = fork();
	if(!liftmove_pid){
		liftmove_process();
	}
	
	int current_person_id = 0;
	int j;
	for(j = 0; j < MAX_N_PERSONS; j++){
	  pid_t tmp_pid = fork();
	  if (tmp_pid == 0){
	    person_process(current_person_id);
	  } else{
	    person_pid[current_person_id] = tmp_pid;
	    current_person_id ++;
	  }
	}
	
	result_process();
	
	return 0;
}
Beispiel #2
0
int main(int argc, char **argv) {
	message_init();
    si_ui_init(); // Initialize user interface. (Must be done here!)

	lift_pid = fork();
	if(!lift_pid) {
		lift_process();
	}
	uidraw_pid = fork();
	if(!uidraw_pid) {
		uidraw_process();
	}
	liftmove_pid = fork();
	if(!liftmove_pid) {
		liftmove_process();
	}
	uicommand_process();

	return 0;
}
Beispiel #3
0
int main(int argc, char **argv) {
    int i;
    int current_person_id = 0;
    int pid;

    printf("Length of time_msg: %lld \n", sizeof(struct long_time_msg));
    message_init();
    si_ui_init(); // Initialize user interface. (Must be done here!)

    lift_pid = fork();
    if(!lift_pid) {
        lift_process();
    }
    uidraw_pid = fork();
    if(!uidraw_pid) {
        uidraw_process();
    }
    liftmove_pid = fork();
    if(!liftmove_pid) {
        liftmove_process();
    }

    guard_pid = fork();
    if(!guard_pid) {
        file_guard_process();
    }
    for (i=0; i<MAX_N_PERSONS; i++) {
        if (current_person_id < MAX_N_PERSONS) {
            pid = fork();
            if (!pid) {
                person_process(current_person_id);
            } else {
                person_pid[current_person_id++] = pid;
            }
        }
    }

    uicommand_process();

    return 0;
}