Arganzheng's Blog

stay hungry, stay foolish

BDB事务共享区域

最后我们来看一下事务共享区域。 首先仍然是每个进程都有的一个数据结构__db_txnmgr{}: /* * The transaction manager encapsulates the transaction system. It contains * references to the log and lock managers as well as the state that...

MPOOL共享内存

2009-5-6 星期三 晴朗 在BDB中所有的共享内存都定义为XXX_REGION{}结构。 比如MPOOL缓冲区,每一个进程有自己的缓存数据结构DB_MPOOL{}: /* * DB_MPOOL -- * Per-process memory pool structure. */ struct __db_mpool { /* These fields need to be pr...

BDB日志共享区域

这一次我们对日志共享区域进行分析。 每个进程都有一个DB_LOG{}数据结构: /* * DB_LOG * Per-process log structure. */ struct __db_log { /* These fields need to be protected for multi-threaded support. */ db_mutex_t *mut...

BDB锁共享区域

这一次我们以锁共享区域分析。 /* * The lock table is the per-process cookie returned from a lock_open call. */ struct __db_locktab { DB_ENV *dbenv; /* Environment. */ REGINFO reginf...

如何确保C库可以正确被C++客户端程序调用

上学期在Linux下打算用C写一个FTP,使用Stevents写的一些C库函数,结果发现在链接的时候老是说找不到那些C库函数,后来才发现我虽然用C来编写代码,但是我在编译的时候却是使用了C++编译器,结果由于Stevents的C库没有考虑给C++客户端使用,所以就找不到了。后来改成用C编译器就没有问题了。 gcc -g -O2 -D_REENTRANT -o ftpClient utili...