delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/24/08:31:19

Date: Wed, 24 Jul 1996 15:22:16 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT edu DOT ar>
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: <Pine.SUN.3.91.960724150419.13991B-100000@is>
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019