?????????????????????
???????????? ???????[ 2013/4/23 10:09:30 ] ????????
???????????
BlockingQueue _queue;
void* process(void* arg)
{
int i=0;
while(true)
{
int *j = new int();
*j = i;
_queue.append((void *)j);
i ++;
}
return NULL;
}
int main(int argc??char** argv)
{
pthread_t pid;
pthread_create(&pid??0??process??0);
long long int start = get_os_system_time();
int i = 0;
while(true)
{
int* j = NULL;
_queue.peek((void* &)j);
i ++;
if(j != NULL && (*j) == 100000)
{
long long int end = get_os_system_time();
printf("consume %d
"??end - start);
break;
}
}
return 0;
}
????????????????
??????
![](/images/ad-banner/ad-banner.png)
???·???
??????????????????
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