Hi,
I've got two questions regarding some statements
in K&B's chapter 'Threads'.
First Question: on pg. 508 it says:
But Objective 7.2 is looking for your ability to
recognize when a thread will get kicked out of running
but not sent back to either runnable or dead.
The while covering the same objective 7.2 on pg 513
What yield() is supposed to do is make
the currently running thread head back to runnable to
allow other threads of the same priority to get their
turn.
At first glance it seems to me that what it says on
pg 508 shouldn't exclude methods (i.e. yield) that
send the
thread back to the runnable state. But
am I missing some important detail?
Second Question: on pg. 510 it says:
When a thread encounters a sleep call, it must
go to sleep for at least the specified number of
milliseconds (unless it is interrupted before its
wake-up time, in which case it immediately throws the
InterruptedException).
Shouldn't
at least be at most? Since the time
after the duration in milliseconds is really spent
in the runnable state and not sleeping?
Thanks,
Gian Franco