run_benchmark 程序入口
First , create the cg_thread instances in the vector threads and then call each cg_thread’s prepare() function of them.
Subsequently, launch each thread in the vector threads
cg_thread
m_base = event_base_new() // line 528
一个client_group 拥有一个m_base
cg_thread key functions
prepare(void)
start()
join()
create_clients(int num)
creating num clients and push them into the m_clients.
client.cpp contrutor function
If creating clients succssfully , go back to the prepare function in memtier_benchmark.cpp
client.cpp 通过 MAIN_CONNECTION 连接服务器完成IP连接
#define MAIN_CONNECTION m_connections[0]
cg_thread_start
m_thread 是 pthread 结构体,将cg_thread (this)本身传进去