Exemplo n.º 1
0
static void ponyint_sched_shutdown()
{
  uint32_t start;

  start = 0;

  for(uint32_t i = start; i < scheduler_count; i++)
    ponyint_thread_join(scheduler[i].tid);

  DTRACE0(RT_END);
  ponyint_cycle_terminate(&scheduler[0].ctx);

  for(uint32_t i = 0; i < scheduler_count; i++)
  {
    while(ponyint_messageq_pop(&scheduler[i].mq) != NULL);
    ponyint_messageq_destroy(&scheduler[i].mq);
    ponyint_mpmcq_destroy(&scheduler[i].q);
  }

  ponyint_pool_free_size(scheduler_count * sizeof(scheduler_t), scheduler);
  scheduler = NULL;
  scheduler_count = 0;

  ponyint_mpmcq_destroy(&inject);
}
Exemplo n.º 2
0
static void ponyint_sched_shutdown()
{
  uint32_t start;

  start = 0;

  for(uint32_t i = start; i < scheduler_count; i++)
    pony_thread_join(scheduler[i].tid);

  ponyint_cycle_terminate(&scheduler[0].ctx);

#ifdef USE_TELEMETRY
  printf("\"telemetry\": [\n");
#endif

  for(uint32_t i = 0; i < scheduler_count; i++)
  {
    while(ponyint_messageq_pop(&scheduler[i].mq) != NULL);
    ponyint_messageq_destroy(&scheduler[i].mq);
    ponyint_mpmcq_destroy(&scheduler[i].q);

#ifdef USE_TELEMETRY
    pony_ctx_t* ctx = &scheduler[i].ctx;

    printf(
      "  {\n"
      "    \"count_gc_passes\": " __zu ",\n"
      "    \"count_alloc\": " __zu ",\n"
      "    \"count_alloc_size\": " __zu ",\n"
      "    \"count_alloc_actors\": " __zu ",\n"
      "    \"count_msg_app\": " __zu ",\n"
      "    \"count_msg_block\": " __zu ",\n"
      "    \"count_msg_unblock\": " __zu ",\n"
      "    \"count_msg_acquire\": " __zu ",\n"
      "    \"count_msg_release\": " __zu ",\n"
      "    \"count_msg_conf\": " __zu ",\n"
      "    \"count_msg_ack\": " __zu ",\n"
      "    \"time_in_gc\": " __zu ",\n"
      "    \"time_in_send_scan\": " __zu ",\n"
      "    \"time_in_recv_scan\": " __zu "\n"
      "  }",
      ctx->count_gc_passes,
      ctx->count_alloc,
      ctx->count_alloc_size,
      ctx->count_alloc_actors,
      ctx->count_msg_app,
      ctx->count_msg_block,
      ctx->count_msg_unblock,
      ctx->count_msg_acquire,
      ctx->count_msg_release,
      ctx->count_msg_conf,
      ctx->count_msg_ack,
      ctx->time_in_gc,
      ctx->time_in_send_scan,
      ctx->time_in_recv_scan
      );

    if(i < (scheduler_count - 1))
      printf(",\n");
#endif
  }

#ifdef USE_TELEMETRY
  printf("\n]\n");
#endif

  ponyint_pool_free_size(scheduler_count * sizeof(scheduler_t), scheduler);
  scheduler = NULL;
  scheduler_count = 0;

  ponyint_mpmcq_destroy(&inject);
}