comp.lang.ada
 help / color / mirror / Atom feed
From: slinky.cs.nyu.edu!slinky.cs.nyu.edu!nobody@nyu.edu  (Robert Dewar)
Subject: Re: Query about monitor (passive) task optimization
Date: 9 Aug 93 04:41:21 GMT	[thread overview]
Message-ID: <244khh$58@schonberg.cs.nyu.edu> (raw)

First of all, Mike says that "we are in disagreement". If we means Robert and
Mike, then he is reading my original message carelessly, since nowhere in that
message did I express my opinion on the matter -- I merely reported the
empirical fact that a substantial number of real-time people object to
automatic recognition of passive tasks.

Well disagreeing with that would say you did not believe this was the case,
but the rest of Mike's message makes it clear that he does recognize this
(although he doesn't like it).

Now, what do I think about this? Well I don't really see a huge market for
optimized tasking that is not under control of the user. Mike says he want
s this factility, but I have trouble believing this, because I doubt he has
applications where this kind of optimization is important. Instead I would
guess he is speaking not for himself, but for a constituency that he imagines
exists. This consituency is not the hard real-time folks [Mike it isn't just
some psychological glitch that makes these people want to control thinks, they
have to have close control if they are to ensure that deadlines are met etc.]

Does this constituency in fact exist? Well I doubt it is significant. Most
people either don't care very much about efficiency of tasking or they care
very much. If you care very much, then you just can't afford to leave it to
some unknown algorithm in the compiler for passive tasking optimization, 
resulting in a situation where you have no idea whether a task you write
represents a real thread of control with its attendant overhead or not.

Mike speaks glibly of improving compiler technology, but the trouble with
optimizations of this kind is that the only technology that is in sight is
the ability to recognize certain special cases. Either these cases are
extremelye easy to describe and program or they are not. If they are, then
you at least want compiler support to make sure that you do not stray outside
the recognized idioms, and you might as well have a pragma for this purpose.
Otherwise you get a situation where a small maintenance change breaks the
optimization pattern, and suddenly there is a big non-linear response in the
performance of the program. If on the other hand the description of what cases
can be optimized is complex (as is likely to be the case, because the compiler
typically will be operating at that stage on a tree that has been subjected
to a series of hard to specify and describe transformations), then you are
in really deep water, since no one can tell what is going on.

A similar sort of situation arises in transformational programming in general.
Should a compiler try major transformations on its own (e.g. replacing a 
simple high level statement of a sort with a complex algorithmn such as
heap sort, or do recursion rearrangement to reduce space usage to linear
instead of exponential?) Well of course such transformations are of course
possible automaticaly in a limited set of circumstances, but you tend to get
a very difficult to use system if you try to do things automatically.

In short, I think it is probably a bad idea to put too much effort into this
kind of optimization. Believe me, there are *plenty* of opportunities for
more straightforward optimization that have by no means been fully exploited.
As a result I think it would be a bad idea for vendors to put much effort
in this area.

One more thing. As we well know, Mike is on the lookout for cheap compilers
for educational use, which is fair enough, but he cannot at the same time
expect to influence the commercial vendors in terms of what optimizations
they might offer. If indeed the constituency that he imagines exists, it
would presumably have resources to encourage the vendors to move in this
direction. The fact that vendors have not heard people clamoring for this
kind of support I think legitimately indicates that this constuency does
not in fact exist. 

The facile belief that compilers can do amazing optimizations is often
heard. Indeed I think the original Ada design was in some cases badly
influenced by this belief (why for instance is there no proper control
over storage management in Ada 83 -- at least part of the answer is that
some people thought that compilers would be able to do an amazing job
of implementing garbage collectors and special storage management
optimizations. Well ten years ago I would have said this was an unrealistic
expectation. Ten years later my opinion is not changed one iota, since
there has been essentially no advance in compiler optimization technology
(of a relevant kind) in this time.

	Robert
	Robert
	Robert   tt

             reply	other threads:[~1993-08-09  4:41 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-08-09  4:41 Robert Dewar [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-08-13  7:32 Query about monitor (passive) task optimization agate!howland.reston.ans.net!darwin.sura.net!sgiblab!munnari.oz.au!goanna
1993-08-11  2:34 agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!u
1993-08-10 23:49 Michael Feldman
1993-08-10 23:14 Michael Feldman
1993-08-10 13:51 Robert Dewar
1993-08-10 13:44 Robert Dewar
1993-08-10  1:47 cis.ohio-state.edu!math.ohio-state.edu!darwin.sura.net!seas.gwu.edu!mfeld
1993-08-10  1:38 cis.ohio-state.edu!math.ohio-state.edu!darwin.sura.net!seas.gwu.edu!mfeld
1993-08-09 21:15 Robert I. Eachus
1993-08-09 14:48 Jonathan Schilling
1993-08-09 12:14 Robert Dewar
1993-08-09 11:02 Richard Kenner
1993-08-09  4:57 Robert Dewar
1993-08-09  4:47 Robert Dewar
1993-08-03 20:10 Michael Feldman
1993-08-03 20:01 Michael Feldman
1993-08-03 15:26 Jonathan Schilling
1993-08-03 10:11 Bjorn Kallberg
1993-08-02 18:17 Michael Feldman
1993-08-02 18:13 Michael Feldman
1993-08-02 17:47 Michael Feldman
1993-08-02 14:35 Jonathan Schilling
1993-08-02 13:19  Arthur Evans
1993-08-02  6:41 Bjorn Kallberg
1993-08-02  3:30 Michael Feldman
1993-08-02  1:57 Jonathan Schilling
1993-08-01  3:25 Michael Feldman
1993-07-31  3:27 Robert Dewar
1993-07-30 17:51 Michael Feldman
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox