🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.ibm.pc.programmer
3 messages
3 total messages Started by Mark Becker Sat, 09 Jun 1990 05:41
Turbo C 2.0 stdio re-entrancy
#663
Author: Mark Becker
Date: Sat, 09 Jun 1990 05:41
28 lines
1248 bytes
Hello *

I'm trying to do two things at once... keeping a time-of-day clock
running in the background and having the same program do some useful
work in the foreground.

This is all in small model.

My first naive try at this crashed out with a Stack Overflow error.

My second try had me reading the Waite Group's MS-DOS Developer's
Guide (Second edition, the sections on TSR's and DOS internal data
structures - InDos and Critical Error flags) and doing some reasonable
things associated with interrupt-driven procedures (saving registers,
switching PSP's, switching DTA's, establishing a separate stack, etc).

Stack Overflow again.

I get the impression that trying to use the same stdio routines
(printf et al) in background as foreground is getting me in trouble
but am unsure of a workaround for this.

Pointers would be appreciated.

Regards,
Mark Becker
mbeck@ai.mit.edu
Re: Turbo C 2.0 stdio re-entrancy
#672
Author: Steve McCoole
Date: Sat, 09 Jun 1990 22:55
19 lines
1251 bytes
In article <8930@rice-chex.ai.mit.edu> mbeck@wheaties.ai.mit.edu (Mark Becker) writes:
>
>I'm trying to do two things at once... keeping a time-of-day clock
>running in the background and having the same program do some useful
>work in the foreground.
>
>I get the impression that trying to use the same stdio routines
>(printf et al) in background as foreground is getting me in trouble
>but am unsure of a workaround for this.
>

You can't use printf or any other routine that tries to malloc memory
while you are in a TSR.  This may well be at least part of your problem.

>Pointers would be appreciated.

No problem.

Steve McCoole | Applied Computing Devices | smm@acd.com / uunet!acd.com!smm
Re: Turbo C 2.0 stdio re-entrancy
#752
Author: Mark McWiggins
Date: Thu, 14 Jun 1990 16:58
13 lines
967 bytes
It doesn't make any difference whether or not Turbo 2.0 is re-entrant,
because DOS isn't.

This is a challenging problem, although there are "TSR kits" that have
been published in magazines and are probably archived in all the normal
places.  Perhaps best to start with one of those.

-- 
Mark McWiggins			Integration Technologies, Inc. (Intek)
+1 206 455 9935			DISCLAIMER:  I could be wrong ...
1400 112th Ave SE #202		Bellevue WA  98004
uunet!intek01!mark		Ask me about C++!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads