???????????

//! ?????????????
void test_2()
{
    thread_t thread;
    task_queue_t tq[3];

    for (unsigned int i = 0; i < sizeof(tq)/sizeof(task_queue_t); ++i)
    {
        thread.create_thread(task_binder_t::gen(&task_queue_t::run?? &(tq[i]))?? 1);
    }

    foo_t foo;
    cout << "helloworld?? thread id:"<< ::pthread_self() << endl;
    for (unsigned int j = 0; j < 100; ++j)
    {
        tq[j % (sizeof(tq)/sizeof(task_queue_t))].produce(task_binder_t::gen(&foo_t::print?? &foo?? j));
        sleep(1);
    }
    thread.join();
}

????????????????з??

??????????????????????????????????????????????????????У????п????????????????????????????С?????????????????????????Ч??????漸????????????????????

?????? ????social game?е???????platform??api?????????httpЭ???????????curl??http??????????????????????????????????????з??????????????????к????п????????????У????A????????B???????????У????????????A??B??????????????б?????A??2k???????B??????????????п???B???????

//! ?????????????
void test_3()
{
    thread_t thread;
    task_queue_t tq;

    thread.create_thread(task_binder_t::gen(&task_queue_t::run?? &tq)?? 3);

    foo_t foo;
    cout << "helloworld?? thread id:"<< ::pthread_self() << endl;
    for (unsigned int j = 0; j < 100; ++j)
    {
        tq.produce(task_binder_t::gen(&foo_t::print?? &foo?? j));
        sleep(1);
    }
    thread.join();
}

??????????е????÷?

?????????

??????????е??????о??????????????????????A????????????B????B???????A????м??????????????????????????н?????ж??????????????????????С????????????????????????????????????????????????????н????????????????

//! ?????
void test_4()
{
    thread_t thread;
    task_queue_t tq;

    thread.create_thread(task_binder_t::gen(&task_queue_t::run?? &tq)?? 1);

    foo_t foo;
    cout << "helloworld?? thread id:"<< ::pthread_self() << endl;
    for (unsigned int j = 0; j < 100; ++j)
    {
        tq.produce(task_binder_t::gen(&foo_t::print_callback?? &foo?? j?? &foo_t::check));
        sleep(1);
    }
    thread.join();
}