all of them. Using notify() is preferable (for efficiency) when only one
blocked thread can benefit from the change (for example, when freeing a
buffer back into a pool). notifyAll() is necessary (for correctness) if multiple
threads should resume (for example, when releasing a “writer”• lock on a
file might permit all “readers”• to resume).
What is meant by time slicing?
Its a task scheduling method. With time slicing, or “Round-Robin Systems”,
several processes are executed sequentially to completion. Each executable
task is assigned a fixed-time quantum called a time slice in which to execute.
How does thread synchronization occurs inside a monitor ?
The JVM uses locks in conjunction with monitors. A monitor is basically a
guardian in that it watches over a sequence of code, making sure only one
thread at a time executes the code. Each monitor is associated with an
object reference. When a thread arrives at the first instruction in a block of
code it must obtain a lock on the referenced object. The thread is not
allowed to execute the code until it obtains the lock. Once it has obtained the
lock, the thread enters the block of protected code. When the thread leaves
the block, no matter how it leaves the block, it releases the lock on the
associated object.
What is Model 1?
Using JSP technology alone to develop Web page. Such term is used in the
earlier JSP specification. Model 1 architecture is suitable for applications
that have very simple page flow, have little need for centralized security
control or logging, and change little over time. Model 1 applications can
control or logging, and change little over time. Model 1 applications can
Do'stlaringiz bilan baham: |