delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/24/10:55:11

From: Sengan DOT Short AT durham DOT ac DOT uk
Message-Id: <6020.9607241449@ws-ai5.dur.ac.uk>
Subject: Re: Multithread question
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Wed, 24 Jul 1996 15:49:50 +0100 (BST)
Cc: djgpp AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.960724150419.13991B-100000@is> from "Eli Zaretskii" at Jul 24, 96 03:22:16 pm
Mime-Version: 1.0

> 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.

Yes it does, so it's ok.

> >  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.

Is that all we have to do? Allocate dos memory, and switch the above value ?

What about malloc: it has a nextf[] structure it uses, so probably is not 
reentrant, right? Do you know of any other functions that might be non-reentrant
like this?

Sengan

- Raw text -


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