Skip to content

BDZ_3 Parallel programming#8

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

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

Conversation

@M-Aksi

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

Copy link
Copy Markdown

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

@okuroshi okuroshi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

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

Copy link
Copy Markdown
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
}

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

Comment thread MyList.c
}

// Функция добавления элемента в конец списка
void append(DoublyLinkedList* list, int value) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

А если передать указатель, который null ?

Comment thread MyList.c
}

// Функция освобождения памяти
void freeList(DoublyLinkedList* list) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

также с null

Comment thread MyList.c
}

// Функция вывода списка от начала к концу
void printForward(const DoublyLinkedList* list){

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Также с null

Comment thread MyList.c
}

// Функция вывода списка от конца к началу
void printBackward(const DoublyLinkedList* list){

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Также с null

Comment thread delay.c
#else
usleep(milliseconds * 1000);
#endif
} No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

потерял \n

Comment thread delay.h

void delay_ms(int milliseconds);

#endif // DELAY_H No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

потерял \n

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

потерял \n

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

.PHONY: all clean No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

потерял \n

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

Copy link
Copy Markdown
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