Article View: comp.lang.postscript
Article #2736Re: "nice" or "sleep" for NeXT PostScript?
From: Glenn Reid
Date: Tue, 07 Aug 1990 16:30
Date: Tue, 07 Aug 1990 16:30
41 lines
2594 bytes
2594 bytes
In article <5972@milton.u.washington.edu> wiml@milton.u.washington.edu (William Lewis) writes:
> A possibly NeXT-specific postscript question ... is there any way to
>"nice" or otherwise reduce the priority/speed of a running PS context?
>For instance, I have a program that just draws lines bouncing around
>the screen ... but if I leave it running in a loop, it loads the machine
>down too much. Some equivalent of "nice" to reduce the priority, or
>"sleep"s that I could slip in here and there, would be quite useful ...
>any postscript gurus out there know if there's a way to do this?
There is a scheduler built into the DPS server that executes a little bit
of each context if there are several of them. This doesn't really load
the machine down, but it seems that way, because the processes' drawing
to the window server gets done a lot less often.
There is a PostScript operator called "yield" that is supposed to yield to
other running contexts. I don't really know if this will work, but you
might try sprinkling "yield" throughout your running loop to see if it
helps.
Here is the definition of "yield" from the DPS manual:
yield
suspends the current context until all other contexts sharing
the same space have had a chance to execute. This should not
be used as a synchronization primitive, since there is no way
to predict how much execution the other contexts will be able
to accomplish. The purpose of "yield" is to break up long-
running computations that might lock out other contexts.
On the other hand, a "space" is defined as belonging to a single application,
so this probably won't help you that much. You might explore the
multiple execution operators like "monitor" and "lock" and "wait" to see
if they can help you, but you would need at least one other cooperating
application to interact with your loop.
There isn't any other way to reduce the priority, as far as I know.
--
Glenn Reid PostScript/NeXT consultant
glenn@heaven.woodside.ca.us Independent Software Developer
..{adobe,next}!heaven!glenn 415-851-1785
Technical Details
Message-ID:
<238@heaven.woodside.ca.us>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!adobe!heaven!glennReferences:
<5972@milton.u.washington.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!adobe!heaven!glenn From: glenn@heaven.woodside.ca.us (Glenn Reid) Newsgroups: comp.lang.postscript,comp.sys.next Subject: Re: "nice" or "sleep" for NeXT PostScript? Keywords: nice, sleep, background, ... Message-ID: <238@heaven.woodside.ca.us> Date: 7 Aug 90 16:30:41 GMT References: <5972@milton.u.washington.edu> Reply-To: glenn@heaven.UUCP (Glenn Reid) Followup-To: comp.lang.postscript Organization: Skyline Press, Woodside CA Lines: 41