1. In the popBottom() method of Fig. 16.11, the bottom field is volatile to assure that in...
Fantastic news! We've Found the answer you've been seeking!
Question:
1. In the popBottom() method of Fig. 16.11, the bottom field is volatile to assure that in popBottom() the decrement at Line 15 is immediately visible. Describe a scenario that explains what could go wrong if bottom were not declared as volatile.
2. Why should we attempt to reset the bottom field to zero as early as possible in the popBottom() method? Which line is the earliest in which this reset can be done safely? Can our BoundedDEQueueoverflow anyway? Describe how.
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: