From 9e6ceaad059b2aec84df92c8750f6d87eab708c2 Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期四, 16 七月 2020 20:46:31 +0800
Subject: [PATCH] udpate
---
test/test_lostdata.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/test/test_lostdata.c b/test/test_lostdata.c
index 5f48b41..87d6dff 100644
--- a/test/test_lostdata.c
+++ b/test/test_lostdata.c
@@ -2,11 +2,9 @@
extern char **environ;
using namespace std;
-SQueue<struct Item> *queue;
-// 閿�姣佸叡浜唴瀛樺拰淇″彿
void sigint_handler(int sig) {
- destroy();
+ // mm_destroy();
exit(0);
}
@@ -14,7 +12,7 @@
signal(SIGINT, sigint_handler);
remove("p.txt");
remove("c.txt");
- int status, i = 0, processors = 5, scale = 100000;
+ int status, i = 0, processors = 4, scale = 100000;
pid_t productors[processors], consumers[processors];
pid_t pid;
@@ -34,7 +32,8 @@
int start = i * scale, end = i * scale + scale;
char cmd[1000];
// char *argv[] = {"productor", start, end, NULL };
- const char *cmdfmt = "./productor %d %d >> p.txt";
+ // const char *cmdfmt = "./single_productor %d %d >> p.txt";
+ const char *cmdfmt = "./single_productor %d %d >> p.txt";
sprintf(cmd, cmdfmt, start, end);
if (execl("/bin/bash", "bash", "-c", cmd, 0) < 0)
{
@@ -49,7 +48,8 @@
// char cmd[1000];
// char *argv[] = {"productor", start, end, NULL };
- const char *cmd = "./consumer >> c.txt";
+ // const char *cmd = "./single_consumer >> c.txt";
+ const char *cmd = "./single_consumer >> c.txt";
if (execl("/bin/bash", "bash", "-c", cmd, 0) < 0)
{
err_exit(errno, "consumers execve");
@@ -68,7 +68,7 @@
perror("waitpid error");
- destroy();
+ //mm_destroy();
--
Gitblit v1.8.0