http://blog.csdn.net/softarts/archive/2009/04/08/4056465.aspx
没事写了这篇文章,正好看到Intel在搞多核编程征文,就去参加了,麻烦看到的人给投个票:)
投票地址:http://intel.csdn.net/multicoreblog/show.aspx?page=1(倒数第4页,谢谢支持)
MemoryPool的lockfree实现-2009/04/07
MemoryPool已经是一个非常古老的话题了,关于此方面的文章比比皆是,在Addison-Wesley 1999年出版的
by
softarts
-
Linux环境编程
-
2009-04-09 16:34:53 阅读(2611) 回复(0)
Hi all, I found the following function, which is used to remove the head of a linked list. void RemoveHead(node **head) { node *temp; if (head && *head) { /* Corrected code */ temp = (*head)->next; free(*head); *head = temp; } } 1. Why is the purpose of 'head' in the 'if' condition? Shouldn't '*head' suffice? 2. This function has an argument, which is a po...
See the registration functiion of notifier chain: static int notifier_chain_register(struct notifier_block **nl, struct notifier_block *n) { while ((*nl) != NULL) { if (n->priority > (*nl)->priority) break; nl = &((*nl)->next); } n->next = *nl; rcu_assign_pointer(*nl, n); return 0; } Why the first parameter is of type pointer to pointer, ...
pointer是指针的意思吧 point是点的意思,偶在学习和工作中接触到他们的机会都比较多 上周去买了本c和指针,现在每天早上起来看看,感觉还不错,每个男人都喜欢梦想,偶也不例外。 最近一周在看《金石奇缘》--tvb新作,呵呵,可能只有15集哦,我想,港台剧看的不少,特别经典的如《流金岁月》…… 的确看的非常舒服,看多了不免想感慨一下,听的最多的一句是“其实做人呢,最重要是开心”,所谓见仁见智,我在每部港剧中都...
A.7.1 pointer Generation If the type of an expression or subexpression is ``array of T,'' for some type T, then the value of the expression is a pointer to the first object in the array, and the type of the expression is altered to ``pointer to T.'' This conversion does not take place if the expression is in the operand of the unary & operator, or of ++, --, sizeof, or as the left operand of an as...
本帖最后由 yshihyu 于 2013-11-26 23:19 编辑
[code]#include
[code]
#include
typedef void (SafeArray::*MFPTR1)(int, int); typedef int (SafeArray::*MFPTR2)(int); MFPTR1 mfPtr1 = 0; MFPTR2 mfPtr2 = 0; mfPtr1 = &SafeArray::set; mfPtr2 = &SafeArray::get; 为什么成员函数指针 需要使用 & 取地址? 而一般函数指针 不需要用到 & ? 谢谢
程序大体如下
void function::remove(U32 clientId)
{
vector ::iterator iter; /*Data为一个定义的类
vector