Message-ID: <000f01c0d57d$48484ce0$64c8c8c8@rafek> From: "Rafal Maj" To: References: <9d0i9v$hdv$1 AT info DOT cyf-kr DOT edu DOT pl> <2950-Sat05May2001181653+0300-eliz AT is DOT elta DOT co DOT il> Subject: Odp: busy-wait loop - djgpp_yeld Date: Sat, 5 May 2001 18:06:01 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Reply-To: djgpp AT delorie DOT com Thanks for help :) Raf256 ----- Original Message ----- From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp To: Rafal Maj Cc: Sent: Saturday, May 05, 2001 17:16 Subject: Re: busy-wait loop - djgpp_yeld > > From: "Rafal Maj" > > 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. --