changes for diff, commit prior to deleteing a lot of old bdb cruft
This commit is contained in:
parent
d8eb6c9aa7
commit
97bf995022
4 changed files with 28 additions and 14 deletions
|
@ -20,16 +20,18 @@
|
|||
|
||||
#define ENV_DIRECTORY "TXNAPP"
|
||||
|
||||
#include "genericBerkeleyDBCode.c"
|
||||
|
||||
int activeThreads = 0;
|
||||
int max_active = 0;
|
||||
|
||||
pthread_mutex_t mutex;
|
||||
|
||||
/*
|
||||
|
||||
void add_cat(DB_ENV *, DB *, char *, ...);
|
||||
void run_xact(DB_ENV *, DB *, int, int);
|
||||
/*void add_color(DB_ENV *, DB *, char *, int);
|
||||
void add_fruit(DB_ENV *, DB *, char *, char *); */
|
||||
//void add_color(DB_ENV *, DB *, char *, int);
|
||||
// void add_fruit(DB_ENV *, DB *, char *, char *);
|
||||
void *checkpoint_thread(void *);
|
||||
void log_archlist(DB_ENV *);
|
||||
void *logfile_thread(void *);
|
||||
|
@ -38,11 +40,13 @@ void env_dir_create(void);
|
|||
void env_open(DB_ENV **);
|
||||
void usage(void);
|
||||
|
||||
int alwaysCommit;
|
||||
|
||||
|
||||
DB_ENV *dbenv;
|
||||
DB *db_cats; /*, *db_color, *db_fruit; */
|
||||
DB *db_cats; //, *db_color, *db_fruit;
|
||||
*/
|
||||
|
||||
int alwaysCommit;
|
||||
int num_xact;
|
||||
int insert_per_xact;
|
||||
void * runThread(void * arg);
|
||||
|
@ -196,7 +200,7 @@ void * runThread(void * arg) {
|
|||
// printf("%d done\n", offset);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void
|
||||
env_dir_create()
|
||||
{
|
||||
|
@ -722,3 +726,4 @@ usage()
|
|||
(void)fprintf(stderr, "usage: txnapp\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include <assert.h>
|
||||
#include <db.h>
|
||||
|
||||
#define ENV_DIRECTORY "TXNAPP"
|
||||
#include "genericBerkeleyDBCode.c"
|
||||
|
||||
#define MAX_SECONDS 100
|
||||
#define COUNTER_RESOLUTION 240
|
||||
|
@ -31,7 +31,7 @@ int max_active = 0;
|
|||
pthread_cond_t never;
|
||||
pthread_mutex_t mutex;
|
||||
|
||||
|
||||
#if 0
|
||||
void run_xact(DB_ENV *, DB *, int, int);
|
||||
void *checkpoint_thread(void *);
|
||||
void log_archlist(DB_ENV *);
|
||||
|
@ -43,6 +43,7 @@ void usage(void);
|
|||
|
||||
DB_ENV *dbenv;
|
||||
DB *db_cats; /*, *db_color, *db_fruit; */
|
||||
#endif
|
||||
|
||||
int num_xact;
|
||||
int insert_per_xact;
|
||||
|
@ -225,7 +226,7 @@ void * runThread(void * arg) {
|
|||
// printf("%d done\n", offset);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void
|
||||
env_dir_create()
|
||||
{
|
||||
|
@ -488,3 +489,5 @@ usage()
|
|||
(void)fprintf(stderr, "usage: txnapp\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif // 0
|
||||
|
||||
|
|
|
@ -130,8 +130,13 @@ terms specified in this license.
|
|||
#define OPERATION_LINEAR_HASH_INSERT 31
|
||||
#define OPERATION_LINEAR_HASH_REMOVE 32
|
||||
|
||||
// this operation is specific to OASYS
|
||||
#define OPERATION_SET_DIFF 33
|
||||
// these operations are specific to OASYS
|
||||
#define OPERATION_OASYS_DIFF_DO 33
|
||||
#define OPERATION_OASYS_DIFF_REDO 34
|
||||
#define OPERATION_OASYS_DIFF_UNDO 35
|
||||
#define OPERATION_OASYS_SEMIDIFF_DO 36
|
||||
#define OPERATION_OASYS_SEMIDIFF_REDO 37
|
||||
|
||||
|
||||
/* number above should be less than number below */
|
||||
#define MAX_OPERATIONS 40
|
||||
|
|
|
@ -345,7 +345,7 @@ void * inner_worker_loop(void * arg_void) {
|
|||
|
||||
int timeout = 0; /* Run through the loop immediately the first time around. */
|
||||
int state = 0;
|
||||
// int first = 1;
|
||||
int first = 1;
|
||||
StateMachine* stateMachine;
|
||||
|
||||
|
||||
|
@ -418,6 +418,7 @@ void * inner_worker_loop(void * arg_void) {
|
|||
DEBUG("Freeing statemachine\n");
|
||||
break;
|
||||
}
|
||||
if(state != stateMachine->current_state) { first = 1; }
|
||||
state = stateMachine->current_state;
|
||||
stateMachine->message.type = stateMachine->current_state;
|
||||
timeout = 690000 +(int) (300000.0*rand()/(RAND_MAX+1.0));
|
||||
|
@ -434,11 +435,11 @@ void * inner_worker_loop(void * arg_void) {
|
|||
send = dfaSet->states[state_idx].retry_fcn(dfaSet, stateMachine, &(stateMachine->message), stateMachine->message_recipient);
|
||||
}
|
||||
if(send) {
|
||||
/* if(first) {
|
||||
if(first) {
|
||||
first = 0;
|
||||
} else {
|
||||
printf("Resending message. Machine # %ld State # %d\n", stateMachine->machine_id, stateMachine->current_state);
|
||||
} */
|
||||
}
|
||||
send_message(&(dfaSet->networkSetup), &(stateMachine->message), stateMachine->message_recipient);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue