Skip to content

БДЗ-3#4

Open
AlekseyBoyarov wants to merge 1 commit intoSergeyBalabaev:mainfrom
AlekseyBoyarov:main
Open

БДЗ-3#4
AlekseyBoyarov wants to merge 1 commit intoSergeyBalabaev:mainfrom
AlekseyBoyarov:main

Conversation

@AlekseyBoyarov
Copy link

ИВТ-24_Бояров_БДЗ-3

@IlyaChichkov IlyaChichkov self-requested a review May 23, 2025 11:14
Copy link
Collaborator

@okuroshi okuroshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавь больше тестов, также ориентированных на проблему многопоточности. Исправь stylecode. Найди какой тебе больше нравится и используй его, также приложи ссылку на него.

} List;

typedef struct ArgProcFunc {
int option; // 1 - единицы с конца, 0 - нули с головы
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вместо комментария добавь enum

List* list;
} ArgProcFunc;

int sumBits(const int* num, const int* option) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет проверки на null

}


void* threadFunc(void* arg_func) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет проверки на null

return NULL;
}

void printList(const List* list) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет проверки на null

}

List* createList(int n) {
List* list = (List*)malloc(sizeof(List));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет проверки на null

scanf_s("%d", &n);
srand(time(NULL));
List* list = createList(n);
//printList(list);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это тут зачем ?


pthread_mutex_init(&mutex, NULL);


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем лишние строки ?

arg_proc_func->option = option;
arg_proc_func->count_bits = count_bits;
arg_proc_func->pass_elements = pass_elements;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нет строки

list->end_list->next = current_node;
}
else {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем лишняя ?

return count_bit;
}


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут тоже лишняя

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants