/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1999-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#include "dttest.h"
#include <vmalloc.h>
** two dictionaries, one built with mmap and the other shmget.
*/
#ifndef N_PROC
#endif
#if N_PROC < 2
#endif
/* a persistent object is a pair of string and decimal number */
typedef struct obj_s
} Obj_t;
/* Cdt discipline to allocate memory from a vmalloc region */
typedef struct _mmdisc_s
} Mmdisc_t;
static char *Mapstore;
static char *Shmstore;
/* allocate data from the shared memory region */
{
}
/* handle dictionary events */
{
if(data) /* at the start of a dictionary opening */
{ if(!ctrl) /* data area not yet constructed */
return 0;
else /* got data area, just return it */
return 1;
}
}
else return 0;
}
if(!ctrl) /* data area just constructed, record it */
}
else return 0; /* data area existed */
}
return 1; /* make sure no objects get deleted */
return 0; /* all done */
}
else return 0;
}
/* compare two objects by their integer keys */
{
}
/* open a shared dictionary based on a common backing store */
{
int proj;
/* discipline for objects identified by their decimal values */
return dt;
}
/* Creating a subprocess */
{
int i;
else if(pid > 0 ) /* return to parent process */
return pid;
else
i = 0;
if (aso)
argv[i++] = "--child";
argv[i] = 0;
}
return -1;
}
{
/* open the shared dictionaries */
/* wait for all to get going first */
/* delete from one and insert to the other */
n_move = 0;
n_move += 1;
}
}
}
tinfo("Process[num=%d,pid=%d]: move %d (%s -> %s)",
return 0;
}
tmain()
{
size_t k, p;
char *aso;
if(k = tchild())
}
terror("Can't get process id");
for(k = 0; k < N_OBJ; ++k)
{ if(random()%2 == 0)
}
else
}
}
for(p = 0; p < N_CONCUR; ++p )
terror("workload subprocess error");
if((k+p) != N_OBJ)
for(k = 0; k < N_OBJ; ++k)
}
texit(0);
}