TD3 II.3+4 stress test our implementation
This commit is contained in:
parent
dcb11cf311
commit
4a67b57492
12 changed files with 95 additions and 13 deletions
|
@ -3,6 +3,7 @@ main()
|
|||
{
|
||||
ForkExec("../test/userpages0");
|
||||
ForkExec("../test/userpages0");
|
||||
while(1);
|
||||
// while(1);
|
||||
ThreadExit();
|
||||
}
|
||||
|
||||
|
|
18
code/test/forkexec_stress.c
Normal file
18
code/test/forkexec_stress.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "syscall.h"
|
||||
|
||||
const int process = 12;
|
||||
|
||||
main()
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<process;i++){
|
||||
int c = i % 2;
|
||||
if ( c==0)
|
||||
ForkExec("../test/userpages0_stress");
|
||||
else
|
||||
ForkExec("../test/userpages1_stress");
|
||||
}
|
||||
ThreadExit();
|
||||
// while(1);
|
||||
}
|
||||
|
|
@ -14,11 +14,11 @@ void f(int c) {
|
|||
|
||||
int main(){
|
||||
int i;
|
||||
for (i=65; i < 98; i++){
|
||||
for (i=90; i < 98; i++){
|
||||
ThreadCreate(f, i);
|
||||
}
|
||||
// PutString("end of main()\n");
|
||||
ThreadExit();
|
||||
//ThreadExit();
|
||||
//return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -14,7 +14,7 @@ int main () {
|
|||
void* f = output;
|
||||
|
||||
ThreadCreate(f,"a");
|
||||
ThreadCreate(f,"b");
|
||||
ThreadCreate(f,"a");
|
||||
PutString("\nthis is the end of our main() in test program\n");
|
||||
ThreadExit();
|
||||
}
|
||||
|
|
21
code/test/userpages0_stress.c
Normal file
21
code/test/userpages0_stress.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include "syscall.h"
|
||||
const int t = 13;
|
||||
|
||||
void output(char* s) {
|
||||
int nb = 10;
|
||||
int i;
|
||||
for(i=0;i<nb;i++)
|
||||
PutString((char*)s);
|
||||
ThreadExit();
|
||||
}
|
||||
|
||||
int main () {
|
||||
|
||||
void* f = output;
|
||||
int i;
|
||||
for (i=0;i<t;i++){
|
||||
ThreadCreate(f,"b");
|
||||
}
|
||||
PutString("\nthis is the end of our main() in test program\n");
|
||||
ThreadExit();
|
||||
}
|
21
code/test/userpages1_stress.c
Normal file
21
code/test/userpages1_stress.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include "syscall.h"
|
||||
const int t = 13;
|
||||
|
||||
void output(char* s) {
|
||||
int nb = 10;
|
||||
int i;
|
||||
for(i=0;i<nb;i++)
|
||||
PutString((char*)s);
|
||||
ThreadExit();
|
||||
}
|
||||
|
||||
int main () {
|
||||
|
||||
void* f = output;
|
||||
int i;
|
||||
for (i=0;i<t;i++){
|
||||
ThreadCreate(f,"a");
|
||||
}
|
||||
PutString("\nthis is the end of our main() in test program\n");
|
||||
ThreadExit();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue