Date: Wed, 24 Jul 1996 15:22:16 +0200 (IST) From: Eli Zaretskii To: "Salvador Eduardo Tropea (SET)" Cc: snarfy AT goodnet DOT com, djgpp AT delorie DOT com Subject: Re: Multithread question In-Reply-To: <9607231343.aa19011@ailin.inti.edu.ar> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.