提交 4b55f65e 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

run mapbench with variable number of threads

上级 a840af36
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
static struct uspinlock l; static struct uspinlock l;
static volatile int tcount; static volatile int tcount;
enum { nthread = 4 };
enum { readaccess = 0 }; enum { readaccess = 0 };
void void
...@@ -40,12 +39,19 @@ thr(void *arg) ...@@ -40,12 +39,19 @@ thr(void *arg)
} }
int int
main(void) main(int ac, char **av)
{ {
mtenable("xv6-mapbench"); mtenable("xv6-mapbench");
if (ac != 2) {
printf(1, "usage: %s nthreads\n", av[0]);
exit();
}
int nthread = atoi(av[1]);
acquire(&l); acquire(&l);
printf(1, "mapbench[%d]: start esp %x\n", getpid(), rrsp()); printf(1, "mapbench[%d]: start esp %x, nthread=%d\n", getpid(), rrsp(), nthread);
for(int i = 0; i < nthread; i++) { for(int i = 0; i < nthread; i++) {
sbrk(8192); sbrk(8192);
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论