-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.c
More file actions
40 lines (29 loc) · 680 Bytes
/
test.c
File metadata and controls
40 lines (29 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include "pool.h"
#include "queue.h"
/**************** Example routines ****************/
int sum(int x) {
//printf("%d \n", x + 2);
sleep(2);
return x + 2;
}
int minus(int x) {
printf("%d \n", x - 2);
return x - 2;
}
int main(int argc, char ** argv) {
if(argc != 2) {
printf("Usage: <thread count> \n");
return 0;
}
initialize(atoi(argv[1]));
for(int i = 0; i < 20; i++) {
addJob(sum);
}
while(1) {
}
return 0;
}