#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
-#include <assert.h>
#include <sys/time.h>
#include <getopt.h>
#include <pthread.h>
unsigned int *actual_loaded);
void flush_all(memcached_st *memc);
+static int opt_binary= 0;
static int opt_verbose= 0;
static int opt_flush= 0;
static int opt_non_blocking_io= 0;
memc= memcached_create(NULL);
memcached_server_push(memc, servers);
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, opt_binary);
+
if (opt_flush)
flush_all(memc);
if (opt_createial_load)
*/
pthread_mutex_lock(&counter_mutex);
while (thread_counter)
- {
- 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);
{"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},
{0, 0, 0, 0},
};
{
case 0:
break;
+ case OPT_BINARY:
+ opt_binary = 1;
+ break;
case OPT_VERBOSE: /* --verbose or -v */
opt_verbose = OPT_VERBOSE;
break;
break;
case OPT_SLAP_CONCURRENCY:
opt_concurrency= strtol(optarg, (char **)NULL, 10);
+ break;
case OPT_SLAP_EXECUTE_NUMBER:
opt_execute_number= strtol(optarg, (char **)NULL, 10);
break;
if (context->execute_pairs)
pairs_free(context->execute_pairs);
- if (context->initial_pairs)
- pairs_free(context->initial_pairs);
-
free(context);
pthread_mutex_lock(&counter_mutex);