Skip to content

Commit

Permalink
teach77
Browse files Browse the repository at this point in the history
  • Loading branch information
sujaypat committed Sep 26, 2016
1 parent 1010eee commit 428671a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions teaching_threads/par_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ double *par_map(double *list, size_t list_len, mapper map_func, size_t num_threa
blazeit * arguments = malloc(min * sizeof(blazeit));

for(index = 0; index < min - 1; index ++){
printf("index: %zu min: %zu block_size: %zu\n", index, min, block_size);
// printf("index: %zu min: %zu block_size: %zu\n", index, min, block_size);
// if(((index + 1) * block_size - 1) > list_len) break;
threads[index] = malloc(sizeof(pthread_t));

Expand All @@ -73,7 +73,7 @@ double *par_map(double *list, size_t list_len, mapper map_func, size_t num_threa
pthread_create(threads[index], NULL, (void *)routine, (void *)(arguments + index));
// }
for(index = 0; index < min; index++){
printf("index: %zu min: %zu\n", index, min);
// printf("index: %zu min: %zu\n", index, min);
pthread_join(*(threads[index]), NULL);
free(threads[index]);
}
Expand Down

0 comments on commit 428671a

Please sign in to comment.