mirror of
https://github.com/kdlucas/byte-unixbench.git
synced 2024-12-11 23:30:07 +08:00
fstime.c - Seperate r/w files for each parallel (#85)
* fstime.c - Seperate r/w files for each parallel Existing workload is using 1 read file and 1 write file for file read/write/copy test. In multi-parallel scenario, it leads to high file lock contention, while read/write/copy is not stressed. This change seperates r/w files for each parallel to satisfy the multi-parallel test purpose.
This commit is contained in:
parent
6705203ac0
commit
81e9de58c5
@ -48,8 +48,8 @@ char SCCSid[] = "@(#) @(#)fstime.c:3.5 -- 5/15/91 19:30:19";
|
||||
#define COUNTSIZE 256
|
||||
#define HALFCOUNT (COUNTSIZE/2) /* Half of COUNTSIZE */
|
||||
|
||||
#define FNAME0 "dummy0"
|
||||
#define FNAME1 "dummy1"
|
||||
char FNAME0[] = "dummy0-XXXXXXXXXX";
|
||||
char FNAME1[] = "dummy1-XXXXXXXXXX";
|
||||
|
||||
int w_test(int timeSecs);
|
||||
int r_test(int timeSecs);
|
||||
@ -170,6 +170,10 @@ char *argv[];
|
||||
}
|
||||
*/
|
||||
|
||||
int pid = getpid();
|
||||
snprintf(FNAME0 + sizeof("dummy0"), sizeof(FNAME0) - sizeof("dummy0"), "%d", pid);
|
||||
snprintf(FNAME1 + sizeof("dummy1"), sizeof(FNAME1) - sizeof("dummy1"), "%d", pid);
|
||||
|
||||
if((f = creat(FNAME0, 0600)) == -1) {
|
||||
perror("fstime: creat");
|
||||
exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user