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

Date: Wed, 24 Jul 1996 18:40:45 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Sengan DOT Short AT durham DOT ac DOT uk
Cc: djgpp AT delorie DOT com
Subject: Re: Multithread question
In-Reply-To: <6020.9607241449@ws-ai5.dur.ac.uk>
Message-Id: <Pine.SUN.3.91.960724183610.14565E-100000@is>
Mime-Version: 1.0

On Wed, 24 Jul 1996 Sengan DOT Short AT durham DOT ac DOT uk wrote:

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

That is the source of non-reentrancy in ALL functions that invoke 
real-mode (DOS and BIOS) services, yes.  After fixing this, one should 
scan libc and look for other causes of non-reentrancy.  I make a rule to 
never call any library function from a multithreaded program if I don't 
know *exactly* what that function does.

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

AFAIK, nobody has made libc functions clean wrt to the reentrancy.  So 
most probably there are other functions that will fail.

- Raw text -


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