Solutions to Chapter 5 - 5.7, 5.10, 5.11, 5.15, 5.17
Prime-Line Products H 3785 Tilt Window Spiral Balance Pivot Lock Shoe, 5/8-Inch, 2-Pack. 4.6 out of 5 stars 80. 57 ($3.79/Item). 5.0 out of 5 stars 2. PH measures how much of an acid or base a substance is. It’s measured according to a scale that ranges from 1.0 to 14.0. On the pH scale: 0 to 7.0 covers the acidic range, while 7.0 to 14 covers basic. Depending on what levels you get during your initial water test, you may have to increase or lower your pH. Ideal pool pH level: 7.4 – 7.6. The local value of balance for the husband becomes 200.00, but before he can commit the transaction, the deposit(100) operation takes place and updates the shared value of balance. The balance lock was a type of boat lift designed by James Fussell (1748-1832 to transport boats up and down a hillside on a canal.An experimental balance lock was built as part of the Dorset and Somerset Canal and work was started for four more, but the project failed.
Wood casement tilt window balance 28 inch window balance window security locks 9/16 inch channel window balance channel accessory kit Related Products Part 868510.
5.7
Race conditions are possible in many computer systems. Consider
a banking system with two methods: deposit(amount) and withdraw(
amount). These two methods are passed the amount that is to be
deposited or withdrawn from a bank account. Assume that a husband
and wife share a bank account and that concurrently the husband calls
the withdraw() method and the wife calls deposit(). Describe howa
race condition is possible and what might be done to prevent the race
condition from occurring.
a banking system with two methods: deposit(amount) and withdraw(
amount). These two methods are passed the amount that is to be
deposited or withdrawn from a bank account. Assume that a husband
and wife share a bank account and that concurrently the husband calls
the withdraw() method and the wife calls deposit(). Describe howa
race condition is possible and what might be done to prevent the race
condition from occurring.
Answer:
Like we talked about in class.
the author's solution:
Assume the balance in the account is 250.00 and the husband calls
withdraw(50) and the wife calls deposit(100). Obviously the correct
value should be 300.00 Since these two transactions will be serialized,
the local value of balance for the husband becomes 200.00, but before
he can commit the transaction, the deposit(100) operation takes place
and updates the shared value of balance to 300.00 We then switch back
to the husband and the value of the shared balance is set to 200.00 -
obviously an incorrect value.
Assume the balance in the account is 250.00 and the husband calls
withdraw(50) and the wife calls deposit(100). Obviously the correct
value should be 300.00 Since these two transactions will be serialized,
the local value of balance for the husband becomes 200.00, but before
he can commit the transaction, the deposit(100) operation takes place
and updates the shared value of balance to 300.00 We then switch back
to the husband and the value of the shared balance is set to 200.00 -
obviously an incorrect value.
5.10
Explain why implementing synchronization primitives by disabling
interrupts is not appropriate in a single-processor system if the synchronization
primitives are to be used in user-level programs.
Answer:
Basically it could manipulate the CPU and actually lock it up.
' If a user-level program is given the ability to disable interrupts, then
it can disable the timer interrupt and prevent context switching from
taking place, thereby allowing it to use the processor without letting
other processes execute.'
interrupts is not appropriate in a single-processor system if the synchronization
primitives are to be used in user-level programs.
Answer:
Basically it could manipulate the CPU and actually lock it up.
' If a user-level program is given the ability to disable interrupts, then
it can disable the timer interrupt and prevent context switching from
taking place, thereby allowing it to use the processor without letting
other processes execute.'
5.11
Explain why interrupts are not appropriate for implementing synchronization
primitives in multiprocessor systems.
Answer:
Other programs runnong on other processores coulde request accees to that data.
'Interrupts are not sufficient in multiprocessor systems since disabling
interrupts only prevents other processes from executing on the processor
in which interrupts were disabled; there are no limitations on what
processes could be executing on other processors and therefore the
process disabling interrupts cannot guarantee mutually exclusive access
to program state.'
primitives in multiprocessor systems.
Answer:
Other programs runnong on other processores coulde request accees to that data.
'Interrupts are not sufficient in multiprocessor systems since disabling
interrupts only prevents other processes from executing on the processor
in which interrupts were disabled; there are no limitations on what
processes could be executing on other processors and therefore the
process disabling interrupts cannot guarantee mutually exclusive access
to program state.'
5.15
Consider how to implement a mutex lock using an atomic hardware
instruction. Assume that the following structure defining the mutex
lock is available:
instruction. Assume that the following structure defining the mutex
lock is available:
typedef struct {
int available;
} lock;
where (available 0) indicates the lock is available; a value of 1
indicates the lock is unavailable. Using this struct, illustrate how the
following functions may be implemented using the test and set()
and compare and swap() instructions.
indicates the lock is unavailable. Using this struct, illustrate how the
following functions may be implemented using the test and set()
and compare and swap() instructions.
- void acquire(lock *mutex)
- void release(lock *mutex)
Be sure to include any initialization that may be necessary.
// initialization
mutex->available = 0;
// acquire using compare and swap()
void acquire(lock *mutex) {
while (compare and swap(&mutex->available, 0, 1) != 0)
;
return;
}
// acquire using test and set()
void acquire(lock *mutex) {
while (test and set(&mutex->available) != 0)
;
return;
}
void release(lock *mutex) {
mutex->available = 0;
return;
}
mutex->available = 0;
// acquire using compare and swap()
void acquire(lock *mutex) {
while (compare and swap(&mutex->available, 0, 1) != 0)
;
return;
}
// acquire using test and set()
void acquire(lock *mutex) {
while (test and set(&mutex->available) != 0)
;
return;
}
void release(lock *mutex) {
mutex->available = 0;
return;
}
5.17
Assume that a system has multiple processing cores. For each of the
following scenarios, describe which is a better locking mechanism—a
spinlock or a mutex lock where waiting processes sleep while waiting
for the lock to become available:
• The lock is to be held for a short duration.
• The lock is to be held for a long duration.
• The thread may be put to sleep while holding the lock.
following scenarios, describe which is a better locking mechanism—a
spinlock or a mutex lock where waiting processes sleep while waiting
for the lock to become available:
• The lock is to be held for a short duration.
• The lock is to be held for a long duration.
• The thread may be put to sleep while holding the lock.
Answer:
• Spinlock
• Mutex lock
• Mutex lock
• Spinlock
• Mutex lock
• Mutex lock
Bracketing automatically varies exposure, flash level, Active D-Lighting (ADL), or white balance slightly with each shot, “bracketing” the current value. Choose in situations in which getting the right settings is difficult and there is not time to check results and adjust settings with each shot, or to experiment with different settings for the same subject.
Balance Lock 1 0 52
Bracketing is adjusted using the Auto bracketing set option in the photo shooting menu, which contains the following options:
- AE & flash bracketing: The camera varies exposure and flash level over a series of photographs (0Exposure and Flash Bracketing). Note that flash bracketing is available in i-TTL and, where supported, auto aperture (qA) flash control modes only (0i-TTL Flash Control, CLS-Compatible Flash Units).
- AE bracketing: The camera varies exposure over a series of photographs.
- Flash bracketing: The camera varies flash level over a series of photographs.
- WB bracketing: The camera creates multiple copies of each photograph, each with a different white balance (0White Balance Bracketing).
- ADL bracketing: The camera varies Active D-Lighting over a series of photographs (0ADL Bracketing).
Exposure and Flash Bracketing
To vary exposure and/or flash level over a series of photographs:
Exposure modified by: –1 EV
- Choose the number of shots.Pressing the BKT button, rotate the main command dial to choose the number of shots in the bracketing sequence. The number of shots is shown in the control panel.Main command dialNumber of shotsExposure and flash bracketing indicatorAt settings other than zero, a M icon and exposure and flash bracketing indicator will appear in the control panel and BKT will be displayed in the viewfinder.
- Select an exposure increment.Pressing the BKT button, rotate the sub-command dial to choose the exposure increment.Sub-command dialAt default settings, the size of the increment can be chosen from 0.3 (1/3), 0.7 (2/3), 1, 2, and 3 EV. The bracketing programs with an increment of 0.3 (1/3) EV are listed below.
Control panel display No. of shots Bracketing order (EVs) 0 0 3 0/+0.3/+0.7 3 0/–0.7/–0.3 2 0/+0.3 2 0/–0.3 3 0/–0.3/+0.3 5 0/–0.7/–0.3/+0.3/+0.7 7 0/–1.0/–0.7/–0.3/+0.3/+0.7/+1.0 9 0/–1.3/–1.0/–0.7/–0.3/+0.3/+0.7/+1.0/+1.3 Note that for exposure increments of 2 EV or more, the maximum number of shots is 5; if a higher value was selected in Step 1, the number of shots will automatically be set to 5. - Frame a photograph, focus, and shoot.The camera will vary exposure and/or flash level shot-by-shot according to the bracketing program selected. Modifications to exposure are added to those made with exposure compensation (0Exposure Compensation).While bracketing is in effect, a bracketing progress indicator will be displayed in the viewfinder and control panel. A segment will disappear from the indicator after each shot.No. shots: 3; increment: 0.7Display after first shot
Balance Lock 1 0 53
Canceling Bracketing
To cancel bracketing, press the BKT button and rotate the main command dial until the number of shots in the bracketing sequence is zero (r) and M is no longer displayed. The program last in effect will be restored the next time bracketing is activated. Bracketing can also be cancelled by performing a two-button reset (0Two-Button Reset: Restoring Default Settings), although in this case the bracketing program will not be restored the next time bracketing is activated.
See Also
For information on:
- Choosing the size of the increment, see A > Custom Setting b2 (EV steps for exposure cntrl, 0EV Steps for Exposure Cntrl).
- Choosing the order in which bracketing is performed, see A > Custom Setting e7 (Bracketing order, 0Bracketing Order).
- Choosing the role of the BKT button, see A > Custom Setting f1 (Custom control assignment) > BKT button + y (0Custom Control Assignment).
Exposure and Flash Bracketing
In continuous low speed, continuous high speed, and quiet continuous modes, shooting will pause after the number of shots specified in the bracketing program have been taken. Shooting will resume the next time the shutter-release button is pressed.
Balance Lock 1 0 56
If the memory card fills before all shots in the sequence have been taken, shooting can be resumed from the next shot in the sequence after the memory card has been replaced or shots have been deleted to make room on the memory card. If the camera is turned off before all shots in the sequence have been taken, bracketing will resume from the next shot in the sequence when the camera is turned on.
Exposure Bracketing
The camera modifies exposure by varying shutter speed and aperture (programmed auto), aperture (shutter-priority auto), or shutter speed (aperture-priority auto, manual exposure mode). If On is selected for ISO sensitivity settings > Auto ISO sensitivity control (0Auto ISO Sensitivity Control) in modes P, S, and A, the camera will automatically vary ISO sensitivity for optimum exposure when the limits of the camera exposure system are exceeded; in mode M, the camera will first use auto ISO sensitivity control to bring exposure as close as possible to the optimum and then bracket this exposure by varying shutter speed. Custom Setting e6 (Auto bracketing (mode M), 0Auto Bracketing (Mode M)) can be used to change how the camera performs exposure and flash bracketing in manual exposure mode. Bracketing can be performed by varying flash level together with shutter speed and/or aperture, or by varying flash level alone.
White Balance Bracketing
The camera creates multiple copies of each photograph, each with a different white balance.
- Choose the number of shots.Final draft windows. Pressing the BKT button, rotate the main command dial to choose the number of shots in the bracketing sequence. The number of shots is shown in the control panel.Main command dialAt settings other than zero, a W icon and WB bracketing indicator will appear in the control panel and BKT will be displayed in the viewfinder.
- Select a white balance increment.Pressing the BKT button, rotate the sub-command dial to choose the white balance adjustment. Each increment is roughly equivalent to 5 mired.Sub-command dialChoose from increments of 1 (5 mired), 2 (10 mired), or 3 (15 mired). Higher B values correspond to increased amounts of blue, higher A values to increased amounts of amber (0Fine-Tuning White Balance). The bracketing programs with an increment of 1 are listed below.
Control panel display No. of shots White balance increment Bracketing order 0 1 0 3 1 B 0/1 B/2B 3 1 A 0/2 A/1 A 2 1 B 0/1 B 2 1 A 0/1 A 3 1 A, 1 B 0/1 A/1 B 5 1 A, 1 B 0/2 A/1 A/1 B/2 B 7 1 A, 1 B 0/3 A/2 A/1 A/1 B/2 B/3 B 9 1 A, 1 B 0/4 A/3 A/2 A/1 A/1 B/2 B/3 B/4 B - Each shot will be processed to create the number of copies specified in the bracketing program, and each copy will have a different white balance. Modifications to white balance are added to the white balance adjustment made with white balance fine-tuning.If the number of shots in the bracketing program is greater than the number of exposures remaining, n and the icon for the affected card will flash in the control panel, a flashing j icon will appear in the viewfinder, and the shutter release will be disabled. Shooting can begin when a new memory card is inserted.
Canceling Bracketing
To cancel bracketing, press the BKT button and rotate the main command dial until the number of shots in the bracketing sequence is zero (r) and W is no longer displayed. The program last in effect will be restored the next time bracketing is activated. Bracketing can also be cancelled by performing a two-button reset (0Two-Button Reset: Restoring Default Settings), although in this case the bracketing program will not be restored the next time bracketing is activated.
White Balance Bracketing
White balance bracketing is not available at an image quality of NEF (RAW). Selecting an NEF (RAW) or NEF (RAW) + JPEG option cancels white balance bracketing.
White balance bracketing affects only color temperature (the amber-blue axis in the white balance fine-tuning display, 0Fine-Tuning White Balance). No adjustments are made on the green-magenta axis.
In self-timer mode, the number of copies specified in the bracketing program will be created each time the shutter is released, regardless of the option selected for Custom Setting c3 (Self-timer) > Number of shots (0Self-Timer).
If the camera is turned off while the memory card access lamp is lit, the camera will power off only after all photographs in the sequence have been recorded.
ADL Bracketing
The camera varies Active D-Lighting over a series of exposures.
- Choose the number of shots.Pressing the BKT button, rotate the main command dial to choose the number of shots in the bracketing sequence. The number of shots is shown in the control panel.Main command dialAt settings other than zero, a d icon and an ADL bracketing indicator appear in the control panel and BKT Find focus 1 0 24 – block distractions printable. will be displayed in the viewfinder. Choose two shots to take one photograph with Active D-Lighting off and another at a selected value. Choose three to five shots to take a series of photographs with Active D-Lighting set to Off, Low, and Normal (three shots), Off, Low, Normal, and High (four shots), or Off, Low, Normal, High, and Extra high (five shots). If you choose more than two shots, proceed to Step 3.
- Select Active D-Lighting.Pressing the BKT button, rotate the sub-command dial to choose Active D-Lighting.Sub-command dialActive D-Lighting is shown in the control panel.
- Y Auto
- Z Extra high
- P High
- Q Normal
- R Low
- The camera will vary Active D-Lighting shot-by-shot according to the bracketing program selected. While bracketing is in effect, a bracketing progress indicator will be displayed in the control panel. A segment will disappear from the indicator after each shot.
Canceling Bracketing
To cancel bracketing, press the BKT button and rotate the main command dial until the number of shots in the bracketing sequence is zero (r) and d is no longer displayed. The program last in effect will be restored the next time bracketing is activated. Bracketing can also be cancelled by performing a two-button reset (0Two-Button Reset: Restoring Default Settings), although in this case the bracketing program will not be restored the next time bracketing is activated.
ADL Bracketing
In continuous low speed, continuous high speed, and quiet continuous modes, shooting will pause after the number of shots specified in the bracketing program have been taken. Shooting will resume the next time the shutter-release button is pressed.
If the memory card fills before all shots in the sequence have been taken, shooting can be resumed from the next shot in the sequence after the memory card has been replaced or shots have been deleted to make room on the memory card. If the camera is turned off before all shots in the sequence have been taken, bracketing will resume from the next shot in the sequence when the camera is turned on.