typedef struct {
char ItemId[MAX_STR_SIZE];
cuda_int indexArrayMap;
cuda_int suporte;
} Elo;
int new_canditatos_cont_suporte_size = 0;
for (int i = 0; i < index_elo_put; ++i) {
int index = 0;
bool newFlag = true;
while (newFlag) {
if (0 == compare(new_canditatos_cont_suporte[index].ItemId, "")) {
new_canditatos_cont_suporte_size++;
my_strcpy(new_canditatos_cont_suporte[index].ItemId,new_canditatos[i]->ItemId);
new_canditatos_cont_suporte[index].indexArrayMap = new_canditatos[i]->indexArrayMap;
new_canditatos_cont_suporte[index].suporte = new_canditatos[i]->suporte;
newFlag = false;
} else if (0 == compare(new_canditatos_cont_suporte[index].ItemId, new_canditatos[i]->ItemId)) {
new_canditatos_cont_suporte[index].suporte += new_canditatos[i]->suporte;
newFlag = false;
} else {
index++;
}
}
}
The threads access the first position of the new support canditates and add their values at the same time. I would like a barrier something of the genre.