コード例 #1
0
ファイル: scheduler.c プロジェクト: nmorey/odp
/* Many queues many threads check priority ODP_SCHED_SYNC_ORDERED */
void scheduler_test_mq_mt_prio_o(void)
{
	int prio = odp_schedule_num_prio();

	parallel_execute(ODP_SCHED_SYNC_ORDERED, MANY_QS, prio, SCHD_ONE,
			 DISABLE_EXCL_ATOMIC);
}
コード例 #2
0
ファイル: main.c プロジェクト: sweetbasil/CS111
int
main (int argc, char **argv)
{
  int opt;
  int command_number = 1;
  int print_tree = 0;
  int time_travel = 0;
  program_name = argv[0];

  for (;;)
    switch (getopt (argc, argv, "pt"))
      {
      case 'p': print_tree = 1; break;
      case 't': time_travel = 1; break;
      default: usage (); break;
      case -1: goto options_exhausted;
      }
 options_exhausted:;

  // There must be exactly one file argument.
  if (optind != argc - 1)
    usage ();

  script_name = argv[optind];
  FILE *script_stream = fopen (script_name, "r");
  if (! script_stream)
    error (1, errno, "%s: cannot open", script_name);
  command_stream_t command_stream =
    make_command_stream (get_next_byte, script_stream);





  command_t last_command = NULL;
  command_t command;
  if (!time_travel){
    while ((command = read_command_stream (command_stream)))
      {
        if (print_tree)
	  {
	    printf ("# %d\n", command_number++);
	    print_command (command);
	  }
        else
	  {
	    last_command = command;
	    execute_command (command, time_travel);
	  }
      }
  }
  else{
    parallel_execute (command_stream);
  }

  return print_tree || !last_command ? 0 : command_status (last_command);
}
コード例 #3
0
ファイル: scheduler.c プロジェクト: nmorey/odp
/* 1 queue many threads check exclusive access on ATOMIC queues multi */
void scheduler_test_multi_1q_mt_a_excl(void)
{
	parallel_execute(ODP_SCHED_SYNC_ATOMIC, ONE_Q, ONE_PRIO, SCHD_MULTI,
			 ENABLE_EXCL_ATOMIC);
}
コード例 #4
0
ファイル: scheduler.c プロジェクト: nmorey/odp
/* Many queues many threads check priority ODP_SCHED_SYNC_ORDERED multi */
void scheduler_test_multi_mq_mt_prio_o(void)
{
	int prio = odp_schedule_num_prio();

	parallel_execute(ODP_SCHED_SYNC_ORDERED, MANY_QS, prio, SCHD_MULTI, 0);
}