ub_server_running
2016-06-22 11:31:05 0 举报
ub_server_running” 是一个表示服务器运行状态的变量。当服务器正在运行时,这个变量的值为 ”true”,反之则为 ”false”。这个变量通常用于检查服务器是否正常运行,以便在出现问题时能够及时处理。例如,如果一个应用程序需要与服务器进行通信,那么在发送请求之前,可以先检查 ”ub_server_running” 的值,以确保服务器处于运行状态。此外,这个变量也可以用于监控系统的健康状况,以便及时发现并解决潜在的问题。总之,”ub_server_running” 是一个非常实用的变量,能够帮助我们更好地管理和维护服务器。
作者其他创作
大纲/内容
......
void* user_buf
....................
void* parent
指针service_handler_base*
thread_data
从client fd读入请求内容
12 pointers 1 per threadeach stores addr of athread_instance_data objadjacently allocated in heap
type=void *size=8 bytes
...........................
nshead
mcpack
ub_server_pdata_t
int fd
字符串\"create_direct_trans\"
一个thread的client fd读入的请求放入本thread的read buffer发往该thread的thread_instance_data里面的handlers_ map里面的对应的service_handler_wrapper对象中的handler对象,比如create_direct_trans_service对象的handle函数处理处理的响应也存入本thread的write buffer最终发给本thread的client fd
内部调用obj-handle()
void* data
thread_instance_data
create_direct_trans_service obj
pay_direct_trans_service obj
pthread_t pid
void* write_buf
12 thread_instance_data obj separately allocated in heap
associate with
g_pkey for thread 1
按nshead+mcpack协议解析请求内容供实际各service对象的handle函数内部消费
.................................
ub_server_handle
Stack
void* usersef_buf
each per-thread pointerstores addr of another pointer storing the addr of the per-thread thread_instance_data obj
type=void*size=sizeof(/thread_instance_data**)
1)inside one thread_instance_data its thread_data member variable is used by all service objs like create_direct_trans_serice for construction2)members of thread_data like sql_db_session_map are initialized inside constructors of service classes like create_direct_trans_service
int (* cb_native)()
thread_instance_data for thread 0newed inside dispatcher::create_thread_datahold own map of cmd-service_handler_wrapper*
total size=12*sizeof(void *)there are 12 pointers1 per threadadjacently allocated in heap
.........................
int sev_sock
13 per-thread data key12 worker threads1 main thread
字符串\"pay_direct_trans\"
void* pool
each thread_instance_data objhas its own set of pointerspointing to their own set of service objs like create_direct_trans_serivce
void* read_buf
Heap
g_pkey for thread 12
向client fd写入响应内容
g_pkey for main thread
redis_client *p_redis_client_
Code
按nshead+mcpack协议打包响应内容实际内容由各service对象的handle函数内部填充
int (* cb_drastic)()
use own thread_data for construction
Data
0 条评论
下一页