C++?????????????
???????????? ???????[ 2013/3/25 13:45:10 ] ????????
???????????
//! ?????????????
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();
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11