本人在学习内核源代码内存模块(2。4。2)时,发现spin_lock有多种实现。 其中一种: #define DEBUG_spinlockS 0 /* 0 == no debugging, 1 == maintain lock state, 2 == full debug */ #if (DEBUG_spinlockS < 1) #define spin_lock(lock) (void)(lock) /* Not "unused variable". */ #elif (DEBUG_spinlockS < 2) #define spin_lock(x) do { (x)->;lock = 1; } while (0) #else /* (DEBUG_spinlockS >;= 2) */ #define s...
by mr_fanwei - 内核/嵌入技术 - 2004-07-14 13:38:34 阅读(1584) 回复(2)
应用的场合可以确定没有recursive,而且是快进快出。 “non-recursive的pthread_mutex_t”和“pthread_spinlock_t”,在性能上有区别吗? linux 2.6.9 kernel.
从新写一段清楚的代码 ipsec_rcv.c543行(freeswan中的文件) [code] if(tdbprev == NULL) { spin_lock(&tdb_lock); } #ifdef CONFIG_IPSEC_IPCOMP if (proto == IPPROTO_COMP) { unsigned int flags = 0; if (tdbp == NULL) { spin_unlock(&tdb_lock); KLIPS_PRINT(debug_rcv, "klips_debug:ipsec_rcv: " "Incoming packet with outer IPCOMP header SA:%s: not yet suppor...
Is anyone know how to prevent lock escalation? I got a lot of this kind of message in my notify log: 2007-06-03-06.55.43.019190 Instance:db2test Node:000 PID:1216710(db2agent (TEST) 0) TID:1 Appid:*LOCAL.db2test.070602225057 data management sqldEscalatelocks Probe:2 Database:TEST ADM5500W DB2 is performing lock escalation. The total number of locks currently held is "65564", and t...
使用select * from v$lock之后可看到如下信息: 请问各位高手,我怎么知道哪个是死锁?sid表示什么意思?如何kill掉这个 死锁? [ 本帖最后由 shaoxia 于 2005-12-22 10:16 编辑 ]