Out on HF and heard nobody, but didn't call CQ? Nobody heard you either. 73 de N7GH
Steven Chu wrote:I understand the the purpose of the Thread.sleep(100) line is to give other threads a chance to do some work. But I'm asking the question, "could it ever be the case that there might not be another thread available?" I know that 10 threads are allocated for this pool, so I guess my main confusion regards how can I be absolutely sure that a deadlock will occur here? Ancillary confusion has to do with things like understanding whether or not the order of submit() calls matter, and when exactly the pool gets populated with tasks.
Steven Chu wrote:
Specifically, I'm wondering whether or not the following could or could not happen.
1. main thread (M) submits first task
2. in pool, first thread (A) submits task
3. in pool, first thread (A) completes task, meaning eatAndDrink() method (notably, including the Thread.sleep(100) call) happens in one fell swoop
ALL before the second task was submitted, and a new thread (B) created for it.
Is this possible?
[OCP 11 Complete Study Guide] [OCP 11 Programmer I Book] [OCP 11 Programmer II Book] [OCP 11 Practice Tests Book] [OCA 8 Book] [OCP 8 Book] [OCP 8 Practice Tests Book] [Blog]