🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2429

Re: Macros and Braces

#2429
From: Ari Lukumies
Date: Fri, 29 Mar 1996 12:08
41 lines
2125 bytes
J. Kanze wrote:
> [snip]
> At the very least, I would expect the program to run slower that if the
> macro were terminated by "while(0)":-).  (Who was it that reported that
> the latest Cray is so fast, it only takes ten minutes for an endless
> loop?)

This is, I admit, off the topic (for comp.lang.c.moderated; note: followups 
redirected to comp.os.research), but I couldn't resist the temptation... IMHO, 
there should be some sort of OS support for programs that accidentally (due to 
a programming error etc) will enter an endless loop. Tandem has (used to 
have?) in their Guardian operating system a feature that can spot endless 
loops. After spotting a process performing one, the OS lowers the priority of 
the process so that eventually it'll be at the end of the scheduling list and 
thus won't affect the performance of other processes. Interesting enough, the 
OS spots processes that do something like this:

	for (i = 0; i < 10; i++)
		i--;

but it does not consider processes that perform some useful stuff as endless 
loopers, as in:

	for (i = 0; i < 10; i++)
	{
		i--;
		if (SomeInputAvailable())
			break;
	}

I would love to see this kind of behaviour in more OSs. Since it's implemented 
in at least one OS, it should be possible to implement it on others that have 
scheduling and priority features.

[Aren't you assuming that things which have been done are possible?  Seems
 like a bit of a leap to me.  :)  -mod]

Later,
 AriL
-- 
All my opinions are mine and mine alone.
Technical Details
Message-ID: <4jgjr1$s99@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: OUI256@USER.COM <4ja3sd$pb9@solutions.solon.com> <4jcklt$9uj@solutions.solon.com> <4je1q2$g39@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
Newsgroups: comp.lang.c.moderated,comp.os.research
Subject: Re: Macros and Braces
Followup-To: comp.os.research
Date: 29 Mar 1996 06:08:01 -0600
Organization: Carelcomp Products
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4jgjr1$s99@solutions.solon.com>
References: OUI256@USER.COM <4ja3sd$pb9@solutions.solon.com>
  <4jcklt$9uj@solutions.solon.com> <4je1q2$g39@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com
X-Mailer: Mozilla 2.0 (WinNT; I)