delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/05/12:03:36

Date: Sat, 05 May 2001 18:16:54 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Rafal Maj" <maj_rafal AT poczta DOT onet DOT pl>
Message-Id: <2950-Sat05May2001181653+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9
CC: djgpp AT delorie DOT com
In-reply-to: <9d0i9v$hdv$1@info.cyf-kr.edu.pl> (maj_rafal@poczta.onet.pl)
Subject: Re: busy-wait loop - djgpp_yeld
References: <9d0i9v$hdv$1 AT info DOT cyf-kr DOT edu DOT pl>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Rafal Maj" <maj_rafal AT poczta DOT onet DOT pl>
> Newsgroups: comp.os.msdos.djgpp
> Date: Sat, 5 May 2001 11:35:35 +0200
> 
> what functions should I all inside my busy-wait loop to make my program nice
> to other tasks ? How can I control "nice" level (Idle or realtime) ?
> With function is most portable ?
> And maybe some Allegro functions are better ?
> 
> while (!finish) {
>   do_calculations();
>   djgpp_yeld();  // ?
>   rest(100); // ?
> }

That function is called __dpmi_yield in DJGPP.

AFAIK, there's no portable function which accomplishes this function.
If you can afford delaying the program a bit, call usleep or sleep,
they both call __dpmi_yield internally, and should have similar
effects on other multitasking OSes.

- Raw text -


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