Conversation
Signed-off-by: Vladislav Dalevich <v.dalevich@g.nsu.ru>
|
|
|
|
| /** | ||
| * Класс, реализующий параллельное решение. | ||
| */ | ||
| public class ParallelDetector implements PrimeNumbersDetector { |
There was a problem hiding this comment.
Как бы ты, как архитектор, принял решение: нужно реализовать интерфейс, нужно унаследовать класс или вообще ничего не нужно?
There was a problem hiding this comment.
Разобраться, что такое абстрактный класс и тогда уже рассказать
| * @return true if numbers are not all prime. | ||
| */ | ||
| @Override | ||
| public boolean isNotPrimeNumbers(Integer[] numbers) { |
There was a problem hiding this comment.
Рассказать про ссылочные типы/значимые
There was a problem hiding this comment.
Разница передачи как аргумента?
There was a problem hiding this comment.
Зачем ввели ссылочные типы для всех значимых?
There was a problem hiding this comment.
Какой класс нужен, чтобы строку в цикле делать?
| } | ||
| }); | ||
|
|
||
| newThread.setUncaughtExceptionHandler( |
There was a problem hiding this comment.
Рассказать зачем вызвал это
|
|
||
| newThread.setUncaughtExceptionHandler( | ||
| (thread, exception) -> { | ||
| synchronized (System.err) { |
There was a problem hiding this comment.
Рассказать, как работает synchronized, зачем ему передавать аргумент?
Рассказать чем отличается synchronized обычный в методе, synchronized метод и synchronized у static метода.
| /** | ||
| * Класс, реализующий многопоточное решение. | ||
| */ | ||
| public class ThreadedDetector implements PrimeNumbersDetector { |
There was a problem hiding this comment.
Отличие процесса от потока?
| int len = TaskDelimiter.lenThreadPart(threadIdx, threadQuantity, numbers.length); | ||
| threads[threadIdx] = createThread(offset, len, numbers, result); | ||
|
|
||
| threads[threadIdx].start(); |
There was a problem hiding this comment.
Runable.run vs Thread.Start - разница в чем?
No description provided.