]>
wirehaze git hosting - ppos.git/blob - ppos/test/pingpong-dispatcher.c
1 // PingPongOS - PingPong Operating System
2 // Prof. Carlos A. Maziero, DINF UFPR
3 // Versão 2.0 -- Junho de 2025
5 // ATENÇÃO: ESTE ARQUIVO NÃO DEVE SER ALTERADO;
6 // ALTERAÇÕES SERÃO DESCARTADAS NA CORREÇÃO.
8 // Teste do dispatcher com escalonador FCFS
14 static struct task_t
*pang
, *peng
, *ping
, *pong
, *pung
;
19 printf("%s: inicio\n", (char *)arg
);
20 for (int i
= 0; i
< 5; i
++)
22 printf("%s: %d\n", (char *)arg
, i
);
25 printf("%s: fim\n", (char *)arg
);
29 // corpo da tarefa principal
30 void user_main(void *arg
)
32 printf("user: criando as tarefas\n");
35 pang
= task_create("pang", body
, "\tPang");
37 peng
= task_create("peng", body
, "\t\tPeng");
39 ping
= task_create("ping", body
, "\t\t\tPing");
41 pong
= task_create("pong", body
, "\t\t\t\tPong");
43 pung
= task_create("pung", body
, "\t\t\t\t\tPung");
46 printf("user: fim\n");