static unsigned int opt_concurrency= 0;
static int opt_displayflag= 0;
static char *opt_servers= NULL;
static unsigned int opt_concurrency= 0;
static int opt_displayflag= 0;
static char *opt_servers= NULL;
test_type opt_test= SET_TEST;
int main(int argc, char *argv[])
test_type opt_test= SET_TEST;
int main(int argc, char *argv[])
+
+ /* We need to set udp behavior before adding servers to the client */
+ if (opt_udp_io)
+ {
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_USE_UDP,
+ (uint64_t)opt_udp_io);
+ for(x= 0; x < servers[0].count; x++ )
+ servers[x].type= MEMCACHED_CONNECTION_UDP;
+ }
- context= (thread_context_st *)malloc(sizeof(thread_context_st));
- memset(context, 0, sizeof(thread_context_st));
+ context= (thread_context_st *)calloc(1, sizeof(thread_context_st));
- {
- struct timespec abstime;
-
- memset(&abstime, 0, sizeof(struct timespec));
- abstime.tv_sec= 1;
-
- pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime);
- }
+ pthread_cond_wait(&count_threshhold, &counter_mutex);
pthread_mutex_unlock(&counter_mutex);
gettimeofday(&end_time, NULL);
pthread_mutex_unlock(&counter_mutex);
gettimeofday(&end_time, NULL);
{"test", required_argument, NULL, OPT_SLAP_TEST},
{"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
{"version", no_argument, NULL, OPT_VERSION},
{"test", required_argument, NULL, OPT_SLAP_TEST},
{"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
{"version", no_argument, NULL, OPT_VERSION},
+ {"binary", no_argument, NULL, OPT_BINARY},
+ {"udp", no_argument, NULL, OPT_UDP},
execute_set(memc, context->execute_pairs, context->execute_number);
break;
case GET_TEST:
execute_get(memc, context->initial_pairs, context->initial_number);
break;
execute_set(memc, context->execute_pairs, context->execute_number);
break;
case GET_TEST:
execute_get(memc, context->initial_pairs, context->initial_number);
break;
pairs_st *load_create_data(memcached_st *memc, unsigned int number_of,
unsigned int *actual_loaded)
{
pairs_st *load_create_data(memcached_st *memc, unsigned int number_of,
unsigned int *actual_loaded)
{