Skip to content

BDZ_3 Parallel programming#8

Open
M-Aksi wants to merge 1 commit intoSergeyBalabaev:mainfrom
M-Aksi:main
Open

BDZ_3 Parallel programming#8
M-Aksi wants to merge 1 commit intoSergeyBalabaev:mainfrom
M-Aksi:main

Conversation

@M-Aksi
Copy link

@M-Aksi M-Aksi commented May 25, 2025

Журавлев Максим ИВТ-24

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. Сделай адекватную историю коммитов либо уже следуй ей дальше, если возникнуть проблемы в разбитие кода на коммите. Остальное в замечаниях

Node* newNode = (Node*)malloc(sizeof(Node));
if (newNode == NULL) {
printf("Memory allocation error!\n");
exit(1); // аварийное завершение
Copy link
Collaborator

Choose a reason for hiding this comment

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

Не пойму что значит 1. Введи типы ошибок и их условные обозначения.

Enum {
E_MEMORY_1
E_SOMETHING_2
E_SOMETHING_3
}

Что-то на подобие этого и обрабатывай разные виды ошибок. Как минимум с сложном коде по названию будет понятно что за тип ошибки, если не до конца ясно логике в коде

}

// Функция добавления элемента в конец списка
void append(DoublyLinkedList* list, int value) {
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 freeList(DoublyLinkedList* 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

}

// Функция вывода списка от начала к концу
void printForward(const DoublyLinkedList* 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

}

// Функция вывода списка от конца к началу
void printBackward(const DoublyLinkedList* 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

#else
usleep(milliseconds * 1000);
#endif
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

потерял \n


void delay_ms(int milliseconds);

#endif // DELAY_H No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

потерял \n

pthread_mutex_destroy(&listMutex); // Уничтожение мьютекса
freeList(&MyList); // освобождение памяти
return 0;
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

потерял \n

clean: # Удаление всех .o-файлов и бинарника
rm -f *.o $(TARGET)

.PHONY: all clean No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

потерял \n

void generateRandomList(DoublyLinkedList* list, int count){
// Инициализация генератора случайных чисел
srand(time(NULL));
for (int i = 0; i < count; ++i){
Copy link
Collaborator

Choose a reason for hiding this comment

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

такая же проблема с codestyle

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