#include "bsl_kv_btree.h" #ifndef BSL_BTREE_WORKS #error "BSL btree doesn't work" #endif #include #include #include #include using namespace std; //对于key需要指定各种compare的方法... struct Key_t { unsigned long long key; Key_t():key(0) { } bool operator==(const Key_t &k)const { return key==k.key; } bool operator!=(const Key_t &k)const { return key!=k.key; } bool operator<(const Key_t &k)const { return key(const Key_t &k)const { return key>k.key; } }; struct Data_t { unsigned long long data; Data_t():data(0) { } }; typedef bsl::bsl_kv_btree_build kv_btree_build_t; typedef bsl::bsl_kv_btree_search kv_btree_search_t; //顺序插入这些数据.. static const int DATA_NR=1000000; void * thread_set(void *arg){ kv_btree_build_t &bt=*(kv_btree_build_t*)arg; for(int i=0;i