Article ID: 176905
Article Last Modified on 11/21/2006
Process A (32-bit) Process B (16-bit)
_________________________ _________________________
| | | |
| 1. Acquire level 2 lock | | |
| | | |
| | 2. Process A | |
| | preempted | |
| | ---------------> | |
| | | 3. Attempt a file write |
| | | |
| | | -acquire kernel32 |
| | | lock |
| | | |
| | | -IFS manager blocks |
| | | on write (Process A |
| | | owns level 2 lock) |
| | 4. Process A | |
| | rescheduled | |
| | <--------------- | |
| 5. Request for level 3 | | |
| lock blocks on | | |
| request for kernel32 | | |
| lock (owned by | | |
| Process B) | | |
|_________________________| |_________________________|
Process A (32-bit) Process B (16-bit)
_________________________ _________________________
| | | |
| 1. Thunk to 16-bit code | | |
| | | |
| 2. Acquire level 2 lock | | |
| | | |
| 3. Acquire level 3 lock | | |
| (acquires kernel32 | | |
| lock) | | |
| | | |
| 4. Return from thunk | | |
| | | |
| | 5. Process A | |
| | preempted | |
| | ---------------> | |
| | | 6. Write blocks on |
| | | request for kernel32 |
| | | lock |
| | | |
| | 7. Process A | |
| | rescheduled | |
| | <--------------- | |
| | | |
| 8. Release level 3 lock | | |
| (releases kernel32 | | |
| lock) | | |
|_________________________| |_________________________|
There is no deadlock here, since process B is no longer blocked. In
reality, process A may be preempted between steps 2 and 3 above, but since
it will then own the Win16 mutex, no other 16-bit process may be scheduled.
Note that this will have consequences on the code design. To ensure
atomicity, the Win16 mutex must not be released between requests for the
level 2 and level 3 volume locks. Hence, these operations must be performed
from within the context of a single thunk.
Additional query words: disk I/O diskio access kernel base win95
Keywords: kbapi kbbug kbkernbase KB176905