🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2688

Re: What does Yield do?

#2688
From: Steve Windsor
Date: Thu, 16 May 1991 18:04
25 lines
1732 bytes
In article <1991May16.121553.3876@maytag.waterloo.edu> dmurdoch@watstat.waterloo.edu (Duncan Murdoch) writes:
>
>Is there some way to configure what sort of behaviour Yield has?  It's not
>even mentioned in Petzold, and the TPW documentation is minimal.  I don't
>have the SDK manual.
>
>Duncan Murdoch

Windows 3.0 is a non-preemptive multitasker.  As such, when a process has
control, no one else can gain access to the processor.  This is why windows
is messaged-based, to process a message and then get out, allowing the
scheduler to service another process.  

Yield() is supposed to relenquish the processor inside a process.  However,
it does not work.  This comes straight from Paul Yao in an Advanced Windows
class, Microsoft University.  In testing, Yield() does not appear to do a
damn thing...

Instead, look at PeekMessage().  If there is a message waiting in the
process queue, you can service that message.  If there is no message
waiting to be serviced, you can relenquish control...the code is
an if (PeekMessage(...))...else construct.  I even think it's mentioned
in Petzold.  I can email you the sample if you wish.

stephen windsor   srw@op632.cci.com
Technical Details
Message-ID: <1991May16.180405.12306@cci632.cci.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!cci632!srw
References: <1991May16.121553.3876@maytag.waterloo.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!cci632!srw
From: srw@cci632.cci.com (Steve Windsor)
Newsgroups: comp.windows.ms.programmer
Subject: Re: What does Yield do?
Message-ID: <1991May16.180405.12306@cci632.cci.com>
Date: 16 May 91 18:04:05 GMT
References: <1991May16.121553.3876@maytag.waterloo.edu>
Reply-To: srw@op632.UUCP (Steve Windsor)
Organization: CCI, Communications Systems Division, Rochester, NY
Lines: 25