executor
을 실행하는 worker
프로세스가 있습니다. Executor
은 10 초짜리 작업을 생성하고 실행하는 프로세스입니다. 그러나 2 초 후에 노동자는 executor
과정을 죽인다. SimGrid는 executor
을 죽이고 나에게 로그를 제공합니다 : 다른 프로세스가 현재 작업 프로세스를 종료 할 때SimGrid에서 보류중인 작업을 삭제하십시오.
[ 2.000000] (0:[email protected]) dp_objs: 1 pending task?
어떻게 제대로 작업을 파괴하고 task_data
해야합니까?
int worker(int argc, char *argv[])
{
msg_process_t x = MSG_process_create("", executor, NULL, MSG_host_self());
MSG_process_sleep(2);
MSG_process_kill(x);
}
int executor(){
MSG_process_on_exit(my_onexit, NULL);
task = MSG_task_create("", 1e10, 10, NULL);
MSG_task_execute(task);
return 0;
}
int my_onexit() {
MSG_task_cancel(task);
XBT_INFO("Exiting now (done sleeping or got killed).");
return 0;
}
UPD : 나는 전역 변수 msg_task_t task
을 선언했다.
[ 2.000000] (0:[email protected]) Oops ! Deadlock or code not perfectly clean.
[ 2.000000] (0:[email protected]) 1 processes are still running, waiting for something.
[ 2.000000] (0:[email protected]) Legend of the following listing: "Process <pid> (<name>@<host>): <status>"
[ 2.000000] (0:[email protected]) Process 2 (@Worker2)
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
내가 그 simgrid이
xbt_info
메시지를 표시 할 것으로 예상,하지만하지 않았다 및
SIGABRT
오류로 중단 : 내가 코드를 실행하면
는 이제 있습니다.
'onexit' 함수에서'task'에 어떻게 접근 할 수 있습니까? –
실행하기 전에 전역 (또는 MSG_process_set_data())에 저장해야합니다. 그 후에 SimGrid 내부를 검색하는 것이 훨씬 쉽습니다. –