Mail Archives: djgpp/1996/07/24/08:31:19
On Tue, 23 Jul 1996, Salvador Eduardo Tropea (SET) wrote:
> If the 1KHz interrupt (used for task switching) arrives when DOS is printing
> (or writing to disk or wherever) the DPMI server reflects the IRQ to the
> protected mode, then the program makes a task switch and if the new task
> calls to DOS again the result is unpredictable.
Doesn't the LWP package work by converting the interrupt into a signal?
If so, then DOS reentrancy isn't an issue, because the signal handling is
delayed until you are back in protected mode.
> b) printf is less reentrant than DOS.
Any function that passes data to or from DOS is non-reentrant because it
uses the transfer buffer. Each task (thread) should allocate its own
transfer buffer to be able to freely use real-mode services which need a
transfer buffer. The scheduler (the signal handler) should change the
value of _go32_info_block.linear_address_of_transfer_buffer on every task
switch, for this to work.
- Raw text -