예제 #1
0
int
ProactorTask::create_demultiplexor(void)
{
    u_int proactors = cfg_.demultiplexors();
    u_int threads   = cfg_.threads ();

    if (threads == 0)
        threads = 1;

    if (proactors == 0)
        proactors = 1;

    if (proactors > threads)
        proactors = threads;

    for (u_int i=0; i < proactors; ++i)
    {
        TRB_Proactor * proactor = create_proactor(i);
        if (!proactor)
        {
            return -1;
        }
        proactor_vect_.push_back (proactor);
    }

    return 0;
}
예제 #2
0
int 
MyTask::svc (void)
{
  ACE_DEBUG ((LM_DEBUG, "(%t) MyTask started\n"));

  create_proactor ();
  disable_signal (ACE_SIGRTMIN, ACE_SIGRTMAX);

  while (ACE_Proactor::event_loop_done () == 0)
    ACE_Proactor::run_event_loop ();

  delete_proactor ();

  ACE_DEBUG ((LM_DEBUG, "(%t) MyTask finished\n"));
  return 0;
}