X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Fms_setting.h;h=4bab2b99d259e3b1b15fb4431778a7ea4000a83a;hb=585b2385384b32af964b5f2f999e70173b33a460;hp=d08998c61ed3ded374744097a8e2811df07568e7;hpb=a7a011c2ea4a63368b3a96a332da00820ed402cb;p=awesomized%2Flibmemcached diff --git a/clients/ms_setting.h b/clients/ms_setting.h index d08998c6..4bab2b99 100644 --- a/clients/ms_setting.h +++ b/clients/ms_setting.h @@ -47,14 +47,14 @@ typedef struct token_s #define MAX_TOKENS 10 /* server information */ -typedef struct mcd_sever +typedef struct mcd_server { char srv_host_name[MCD_HOST_LENGTH]; /* host name of server */ int srv_port; /* server port */ /* for calculating how long the server disconnects */ - int disconn_cnt; /* number of disconnections count */ - int reconn_cnt; /* number of reconnections count */ + volatile uint32_t disconn_cnt; /* number of disconnections count */ + volatile uint32_t reconn_cnt; /* number of reconnections count */ struct timeval disconn_time; /* start time of disconnection */ struct timeval reconn_time; /* end time of reconnection */ } ms_mcd_server_t; @@ -88,7 +88,7 @@ typedef enum cmd_type { CMD_SET, CMD_GET, - CMD_NULL, + CMD_NULL } ms_cmd_type_t; /* types in the configuration file */ @@ -97,7 +97,7 @@ typedef enum conf_type CONF_KEY, CONF_VALUE, CONF_CMD, - CONF_NULL, + CONF_NULL } ms_conf_type_t; /* information of command distribution */ @@ -110,9 +110,9 @@ typedef struct cmd_distr /* global setting structure */ typedef struct setting { - int ncpu; /* cpu count of this system */ - int nthreads; /* total thread count, must equal or less than cpu cores */ - int nconns; /* total conn count, must multiply by total thread count */ + uint32_t ncpu; /* cpu count of this system */ + uint32_t nthreads; /* total thread count, must equal or less than cpu cores */ + uint32_t nconns; /* total conn count, must multiply by total thread count */ int64_t exec_num; /* total execute number */ int run_time; /* total run time */ @@ -124,8 +124,8 @@ typedef struct setting char *cfg_file; /* configure file name */ ms_mcd_server_t *servers; /* servers array */ - int total_srv_cnt; /* total servers count of the servers array */ - int srv_cnt; /* servers count */ + uint32_t total_srv_cnt; /* total servers count of the servers array */ + uint32_t srv_cnt; /* servers count */ ms_key_distr_t *key_distr; /* array of key distribution */ int total_key_rng_cnt; /* total key range count of the array */ @@ -152,13 +152,13 @@ typedef struct setting bool reconnect; /* whether it reconnect when connection close */ bool verbose; /* whether it outputs detailed information when verification */ bool facebook_test; /* facebook test, TCP set and multi-get with UDP */ - int sock_per_conn; /* number of socks per connection structure */ - bool binary_prot; /* whether it use binary protocol */ + uint32_t sock_per_conn; /* number of socks per connection structure */ + bool binary_prot_; /* whether it use binary protocol */ int expected_tps; /* expected throughput */ - int rep_write_srv; /* which servers are used to do replication writing */ -} ms_setting_t; + uint32_t rep_write_srv; /* which servers are used to do replication writing */ +} ms_setting_st; -extern ms_setting_t ms_setting; +extern ms_setting_st ms_setting; /* previous part of initialization of setting structure */ void ms_setting_init_pre(void);