Commit e7b03d37 authored by Samarth Joshi's avatar Samarth Joshi

50 threads test

parent de9d376a
No preview for this file type
File added
File added
......@@ -148,7 +148,7 @@ int main(int argc, char const *argv[])
int seconds = 1;
int i;
if(1) {
if(0) {
sock = client_init();
interactive(sock);
return 0;
......@@ -167,8 +167,8 @@ int main(int argc, char const *argv[])
}
if(seconds%5==0) {
printf("%d, %f\n", i, ((float)sum/seconds));
//pthread_create( &seige_threads[i], NULL, seige, requestcompleted+i );
//i++;
pthread_create( &seige_threads[i], NULL, seige, requestcompleted+i );
i++;
}
if(i==max_concurrent) {
break;
......
......@@ -150,12 +150,12 @@ int main (int argc, int argv) {
int i;
int next_thread_to_assign = 0;
pthread_t *worker_threads;
int pool_thread_size = 1; // TODO: get pool thread size from config file
int pool_thread_size = 50; // TODO: get pool thread size from config file
int sockfd, newsockfd, portno, clilen, n;
struct sockaddr_in serv_addr, cli_addr;
//int *pipes = (int*) malloc(pool_thread_size * 2 * sizeof(pipes));
int pipes[1][2]; // TODO: initialize pipes dynamically
int pipes[50][2]; // TODO: initialize pipes dynamically
worker_threads = malloc(pool_thread_size * sizeof(pthread_t));
for( i=0; i < pool_thread_size; i++ ) {
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment