mirror of
https://github.com/RustyRaptor/parallel-programming.git
synced 2026-12-03 15:55:15 -07:00
cleaned up some code
This commit is contained in:
1 parent
19418996e9
commit
d1a1601e70
1 file changed
+5
-6
+5
-6
@@ -86,12 +86,11 @@ void *count3s(void *idx)
|
||||
|
||||
int valueforthread = 0;
|
||||
|
||||
// valueforthread->value =
|
||||
|
||||
// if (DEBUG) {
|
||||
// printf("start is %d\n", mystart);
|
||||
// printf("end is %d\n", myend);
|
||||
// }
|
||||
if (DEBUG) {
|
||||
printf("start is %d\n", mystart);
|
||||
printf("end is %d\n", myend);
|
||||
}
|
||||
|
||||
for (int i = mystart; i < myend; i++) {
|
||||
if (A[i] == 3) {
|
||||
@@ -171,7 +170,7 @@ int count3s_parallel()
|
||||
// wait for all the treads to finish.
|
||||
for (int i = 0; i < NUMOFTHREADS; i++) {
|
||||
pthread_join(t_idents[i], NULL);
|
||||
COUNT += (t_results[i].value);
|
||||
COUNT += t_results[i].value;
|
||||
}
|
||||
|
||||
// free the ids and indexes in memory so we dont leak
|
||||
|
||||
Reference in new issue
Block a user