www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/13/02:18:03

Date: Wed, 13 Nov 1996 09:09:22 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Alaric B. Williams" <alaric AT abwillms DOT demon DOT co DOT uk>
Cc: djgpp AT delorie DOT com
Subject: Re: True Processor-aided PM multitasking
In-Reply-To: <847822218.17951.1@abwillms.demon.co.uk>
Message-Id: <Pine.SUN.3.91.961113090428.4470F-100000@is>
Mime-Version: 1.0

On Tue, 12 Nov 1996, Alaric B. Williams wrote:

> The compiler has been adjusted to insert "Should I yield?"
> instructions at frequent points in the code (one per loop construct,
> certainly, and one per 100 or so instructions).
> 
> The "Should I yield?" is a simple compare-the-flag, and if the switch
> flag is set, PUSHAD (save all registers to the stack) and invoke the
> task switch function, then POPAD and continue execution.
> 
> The "should I yield?" thus clobbers no registers, ever.

For truely general-purpose multitasking, you should also do an FSAVE on
behalf of the yielding task and FRSTOR on behalf of the task which gets
control.  Otherwise, the threads will crash and burn if they use FP
instructions. 

- Raw text -


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