libcats.org
Главная

Java Threads

Обложка книги Java Threads

Java Threads

,
This book makes the following claims which as far as I can see are entirely baseless, for the reasons given:



> A Java virtual machine is required to implement a preemptive, priority-based scheduler



The word 'pre-emptive' does not appear in the JLS.



> The Java virtual machine never changes the priority of a thread, even if the thread has been running for a certain period of time



Can't find that anywhere either.



> the contract between the Java virtual machine and the underlying operating system is that the operating system must generally choose to run the Java thread with the highest priority



The 'contract' is between the Java code and the JVM, not the JVM and the O/S.



> That's what we mean when we say that Java implements a priority-based scheduler



Java isn't required to 'implement' a scheduler at all.



> This scheduler is implemented in a preemptive fashion, meaning that when a higher-priority thread comes along, that thread interrupts (preempts) whatever lower-priority thread is running at the time.



This appears nowhere in the JLS.



> The contract with the operating system, however, is not absolute, which means that the operating system can sometimes choose to run a lower-priority thread.



In other words it's +not+ pre-emptive. Make up your mind.



> Java's requirement for a priority-based, preemptive scheduling mechanism ...



Which is nowhere to be found.



> A Java thread can have one of 11 priorities



MIN_PRIORITY is 1, MAX_PRIORITY is 10: that makes 10, not 11.



> In fact, preemption means only that a higher-priority thread runs instead of a lower-priority one



No it doesn't. It means that when a higher-priority thread becomes ready it pre-empts the execution of any lower-priority threads that are currently executing regardless of time-slice etc. This is a feature of real-time systems that Java is +not+ required to implement.



This book cannot be recommended in the presence of these egregious errors. Doug Lea's book as recommended by other reviewers is the one to go for.
EPUB | FB2 | MOBI | TXT | RTF
* Конвертация файла может нарушить форматирование оригинала. По-возможности скачивайте файл в оригинальном формате.
Популярные книги за неделю:

Ключ к сверхсознанию

Автор:
Категория: Путь к себе
Размер книги: 309 Kb

Древо жизни

Автор:
Категория: Путь к себе
Размер книги: 1.70 Mb

Здоровье надо созидать

Автор:
Категория: Здоровье
Размер книги: 363 Kb

Шликерное литье

Автор:
Категория: science, science, technical
Размер книги: 5.98 Mb
Только что пользователи скачали эти книги:

Бедные люди

Автор:
Размер книги: 44 Kb

Темп

Автор:
Категория: Драматургия
Размер книги: 333 Kb

From Primordial Quantum Fluctuations to the Anisotropies of CMBR

Автор:
Категория: Physics, Gravitation, Cosmology
Размер книги: 834 Kb

Eyes That Witnessed Madness

Автор:
Размер книги: 2 Kb

The Story

Автор:
Размер книги: 2 Kb

Последний властитель

Автор:
Категория: Фантастика
Размер книги: 840 Kb

[Cowboy 03] Cave Creek Cowboy in Vegas]

Автор:
Категория: fiction
Размер книги: 65 Kb