home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / csmpdigest / csmp-digest-v3-026 < prev    next >
Text File  |  2010-09-21  |  77KB  |  1,979 lines

  1. Received-Date: Fri, 13 May 1994 00:30:51 +0200
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-026
  4. To: csmp-digest@ens.fr
  5. Date: Fri, 13 May 94 0:30:43 MET DST
  6. X-Mailer: ELM [version 2.3 PL11]
  7. Errors-To: listman@ens.fr
  8. Reply-To: pottier@clipper.ens.fr
  9. X-Sequence: 29
  10.  
  11. C.S.M.P. Digest             Thu, 12 May 94       Volume 3 : Issue 26
  12.  
  13. Today's Topics:
  14.  
  15.         Can I send Apple Event from Script Editor?
  16.         Disk Cache performance evaluation test software
  17.         Extension Shell 1.3 - Help for INIT writers
  18.         FFT benchmark using CodeWarrior
  19.         How do I find the window colour ???
  20.         Private inheritance faulty in SC++ 7.0
  21.         Source Control Questions
  22.         Using xlc to generate PowerMacintosh code
  23.  
  24.  
  25.  
  26. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  27. (pottier@clipper.ens.fr).
  28.  
  29. The digest is a collection of article threads from the internet newsgroup
  30. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  31. regularly and want an archive of the discussions.  If you don't know what a
  32. newsgroup is, you probably don't have access to it.  Ask your systems
  33. administrator(s) for details.  If you don't have access to news, you may
  34. still be able to post messages to the group by using a mail server like
  35. anon.penet.fi (mail help@anon.penet.fi for more information).
  36.  
  37. Each issue of the digest contains one or more sets of articles (called
  38. threads), with each set corresponding to a 'discussion' of a particular
  39. subject.  The articles are not edited; all articles included in this digest
  40. are in their original posted form (as received by our news server at
  41. nef.ens.fr).  Article threads are not added to the digest until the last
  42. article added to the thread is at least two weeks old (this is to ensure that
  43. the thread is dead before adding it to the digest).  Article threads that
  44. consist of only one message are generally not included in the digest.
  45.  
  46. The digest is officially distributed by two means, by email and ftp.
  47.  
  48. If you want to receive the digest by mail, send email to listserv@ens.fr
  49. with no subject and one of the following commands as body:
  50.     help                        Sends you a summary of commands
  51.     subscribe csmp-digest Your Name    Adds you to the mailing list
  52.     signoff csmp-digest            Removes you from the list
  53. Once you have subscribed, you will automatically receive each new
  54. issue as it is created.
  55.  
  56. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  57. Questions related to the ftp site should be directed to
  58. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  59. digest are available there.
  60.  
  61. Also, the digests are available to WAIS users as comp.sys.mac.programmer.src.
  62.  
  63.  
  64. -------------------------------------------------------
  65.  
  66. >From RTY868@email.nml.mot.com (Masaaki Iwasa)
  67. Subject: Can I send Apple Event from Script Editor?
  68. Date: Wed, 27 Apr 1994 09:03:56 GMT
  69. Organization: Nippon Motorola Limited,  Tokyo  Japan
  70.  
  71. Dose someone know if an Apple Event can be sent from within Script Editor
  72. to an Apple Event aware but not Apple Scriptable program?
  73.  
  74. I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  75. know I can send them from HyperCard.
  76.  
  77. No way??
  78.  
  79. -- 
  80. Masaaki Iwasa                    LMPS, Nippon Motorola Limited
  81. Email: RTY868@email.nml.mot.com   /  MHA01341@niftyserve.or.jp
  82.  
  83. +++++++++++++++++++++++++++
  84.  
  85. >From jwbaxter@olympus.net (John W. Baxter)
  86. Date: Thu, 28 Apr 1994 07:28:26 -0700
  87. Organization: Internet for the Olympic Peninsula
  88.  
  89. In article <RTY868-270494180057@180.3.150.33>, RTY868@email.nml.mot.com
  90. (Masaaki Iwasa) wrote:
  91.  
  92. > Dose someone know if an Apple Event can be sent from within Script Editor
  93. > to an Apple Event aware but not Apple Scriptable program?
  94. > I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  95. > know I can send them from HyperCard.
  96.  
  97. You can send arbitrary Apple events to any application which has the proper
  98. bit set to say it accepts high level events.
  99.  
  100. The syntax in AppleScript for doing so is rather ugly...if you have Think
  101. Project Manager 6 (or, likely 7, but I'm not sure of that), try turning
  102. recording on in the Script Editor, then going into Think Project Manager
  103. and changing the option regarding the generation of MacsBug symbols.  That
  104. should record as a generic event, and give you an idea of the syntax.
  105.  
  106. UserLand Frontier provides a somewhat clearer syntax for sending such
  107. events...in either scripting system, you can of course write subroutines
  108. which hide the gory mess from the rest of your code.
  109.  
  110. -- 
  111. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  112.    jwbaxter@pt.olympus.net
  113.  
  114. +++++++++++++++++++++++++++
  115.  
  116. >From isis@netcom.com (Mike Cohen)
  117. Date: Thu, 28 Apr 1994 18:29:22 GMT
  118. Organization: ISIS International
  119.  
  120. RTY868@email.nml.mot.com (Masaaki Iwasa) writes:
  121.  
  122. >Dose someone know if an Apple Event can be sent from within Script Editor
  123. >to an Apple Event aware but not Apple Scriptable program?
  124.  
  125. >I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  126. >know I can send them from HyperCard.
  127.  
  128. >No way??
  129.  
  130. >-- 
  131. >Masaaki Iwasa                    LMPS, Nippon Motorola Limited
  132. >Email: RTY868@email.nml.mot.com   /  MHA01341@niftyserve.or.jp
  133.  
  134. you can send any event using something like:
  135.  tell application "foo" to <<event XXXXYYYY>> directobject given
  136.     <<class ZZZZ>> someotherparam
  137.  
  138. Note that the << and >> should really be opt-backslash & shift-opt-backslash.
  139. -- 
  140. Mike Cohen - isis@netcom.com
  141. NewtonMail, eWorld: MikeC / ALink: D6734 / AOL: MikeC20
  142.  
  143. +++++++++++++++++++++++++++
  144.  
  145. >From paul@ctalk.exnet.com (Paul G Smith)
  146. Date: Thu, 28 Apr 94 21:45:33 GMT
  147. Organization: commstalk, & Full Moon Software Inc
  148.  
  149.  
  150. In article <isisCozFCy.JAM@netcom.com> (comp.sys.mac.programmer), isis@netcom.com (Mike Cohen) writes:
  151. > >Dose someone know if an Apple Event can be sent from within Script Editor
  152. > >to an Apple Event aware but not Apple Scriptable program?
  153. > >I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  154. > >know I can send them from HyperCard.
  155. > >No way??
  156. > >-- 
  157. > >Masaaki Iwasa                    LMPS, Nippon Motorola Limited
  158. > >Email: RTY868@email.nml.mot.com   /  MHA01341@niftyserve.or.jp
  159. > you can send any event using something like:
  160. >  tell application "foo" to <<event XXXXYYYY>> directobject given
  161. >     <<class ZZZZ>> someotherparam
  162.  
  163. There is another way to do this... not guaranteed to be the best solution
  164. for your needs, but it will make for easier scripting:
  165.  
  166. Why not create an 'aete' resource for Microsoft Project? It's not
  167. a trivial task, admittedly, but it's not all that hard (especially
  168. if you take one from another app to use as a starting point). There
  169. is a template for ResEdit for editing aete resources. When you have
  170. done this, and given a human-readable terminology to the apple events,
  171. you'll find it _very_ easy to script them from the Script Editor.
  172.  
  173.  
  174. best regards, Paul
  175.  
  176. - --------------------------------------------------------------
  177. Paul G Smith, Commstalk HQ          ||  UK ph: +44 727 844232
  178. P O Box 116, ST ALBANS              ||    fax: +44 727 856139
  179. Hertfordshire. AL1 2RL. UK          ||  US ph: 408 253 7199
  180. & Full Moon Software, Inc           ||    fax: 408 252 2378
  181. P O Box 700237, SAN JOSE, CA 95170  ||  AppleLink: COMMSTALK.HQ 
  182.  
  183. ---------------------------
  184.  
  185. >From Stuart Cheshire <cheshire@cs.stanford.edu>
  186. Subject: Disk Cache performance evaluation test software
  187. Date: 9 Apr 1994 17:38:54 GMT
  188. Organization: Stanford University
  189.  
  190. The test program writes 512K to disk, using various block sizes, from 1024
  191. FSWrite calls of 512 bytes each to 32 FSWrite of 16K each.
  192.  
  193. Each test is done three ways, firstly with simple FSWrite, then with FSWrite
  194. alternating with PBFlushFile, and then with FSWriteNoCache.
  195.  
  196. The first is what you might naively write in a program which is trying to run
  197. cooperatively in the background while transferring a file to disk. It results
  198. in all the writes going to the cache, and then the Mac freezes solid for ten
  199. seconds when the file is closed.
  200.  
  201. The second is an attempt to fix this by flushing the file to disk after every
  202. write. It achieves the goal of spreading the delay over all the writes,
  203. instead of having a big freeze at the end, but it still takes over 10 seconds.
  204.  
  205. The third method was pointed out to me by Jim Matthews (author of Fetch). It
  206. uses the little known (but supported -- see IM:Files, page 89) non-caching
  207. option of PBWrite.
  208. Similarly, this achieves the goal of spreading the delay over all the writes,
  209. but it also makes it go up to 25 times faster.
  210.  
  211. Results:
  212.  
  213. Tests were performed with a Macintosh Quadra 700, System 7.0.1/Tuneup 1.1.1,
  214. 768KB disk cache, 32 bit addressing, no virtual memory, 20MB RAM:
  215.  
  216. Testing Writing 512K in various block sizes
  217. Testing 0.5K blocks
  218. Standard writes:    Write:  39 (! 0s)  Close: 691 (!11s)  Total: 730 (!12s)
  219. Write and flush:    Write: 689 (!11s)  Close:   1 (! 0s)  Total: 690 (!11s)
  220. No-cache writes:    Write: 689 (!11s)  Close:   1 (! 0s)  Total: 690 (!11s)
  221. Testing   1K blocks
  222. Standard writes:    Write:  26 (! 0s)  Close: 691 (!11s)  Total: 717 (!11s)
  223. Write and flush:    Write: 691 (!11s)  Close:   1 (! 0s)  Total: 692 (!11s)
  224. No-cache writes:    Write: 346 (! 5s)  Close:   0 (! 0s)  Total: 346 (! 5s)
  225. Testing   2K blocks
  226. Standard writes:    Write:  23 (! 0s)  Close: 692 (!11s)  Total: 715 (!11s)
  227. Write and flush:    Write: 691 (!11s)  Close:   0 (! 0s)  Total: 691 (!11s)
  228. No-cache writes:    Write:  85 (! 1s)  Close:   0 (! 0s)  Total:  85 (! 1s)
  229. Testing   4K blocks
  230. Standard writes:    Write:  21 (! 0s)  Close: 692 (!11s)  Total: 713 (!11s)
  231. Write and flush:    Write: 691 (!11s)  Close:   1 (! 0s)  Total: 692 (!11s)
  232. No-cache writes:    Write:  51 (! 0s)  Close:   0 (! 0s)  Total:  51 (! 0s)
  233. Testing   8K blocks
  234. Standard writes:    Write:  21 (! 0s)  Close: 691 (!11s)  Total: 712 (!11s)
  235. Write and flush:    Write: 690 (!11s)  Close:   1 (! 0s)  Total: 691 (!11s)
  236. No-cache writes:    Write:  39 (! 0s)  Close:   0 (! 0s)  Total:  39 (! 0s)
  237. Testing  16K blocks
  238. Standard writes:    Write:  17 (! 0s)  Close: 692 (!11s)  Total: 709 (!11s)
  239. Write and flush:    Write: 694 (!11s)  Close:   0 (! 0s)  Total: 694 (!11s)
  240. No-cache writes:    Write:  26 (! 0s)  Close:   1 (! 0s)  Total:  27 (! 0s)
  241.  
  242. Notice that:
  243.  
  244. 1. With the simple writes, every block size, even 16K, incurs a Mac-crippling
  245. ten second freeze when the file is closed.
  246.  
  247. 2. Using write and flush takes the same time as simple writes, but spread
  248. over all the Write calls instead of in a single big freeze at the end.
  249.  
  250. 3. In BOTH of the above cases, it takes at best 691 ticks to write 512K,
  251. making a data rate of 44.5K/sec.
  252.  
  253. 4. Using No-cache writes incurs no freeze for the close call, and if you are
  254. writing 4K blocks it achieves 602K/sec, more than ten times faster than the
  255. simple writes. If you are prepared to go to 16K blocks, it exceeds a
  256. megabyte per second -- more than 25 times faster than simple writes with
  257. the same block size.
  258.  
  259. If anyone wishes to run the test program and give me results for other
  260. configurations, why not post those results here.
  261.  
  262. Stuart Cheshire <cheshire@cs.stanford.edu>
  263.  * <A HREF="file://brubeck.stanford.edu/www/cheshire-bio.html">WWW</A>
  264.  * Stanford Distributed Systems Group Research Assistant
  265.  * Escondido Village Resident Computer Coordinator
  266.  * Macintosh Programmer
  267. >From Stuart Cheshire <cheshire@cs.stanford.edu>
  268. Subject: Disk Cache performance evaluation test software
  269. Date: 9 Apr 1994 18:48:06 GMT
  270. Organization: Stanford University
  271.  
  272. // Copyright (C) 23rd November 1993
  273. // Stuart Cheshire <cheshire@cs.stanford.edu>
  274.  
  275. #include <stdio.h>
  276. #include <stdlib.h>
  277.  
  278. #define FILE_SIZE      0x80000
  279. #define MAX_BLOCK_SIZE 0x4000
  280. static char *buffer;
  281. static SysEnvRec sysenvirons;
  282. static const unsigned char filename[] = "\pFlusherTestFile";
  283. static IOParam fileflusher;
  284.  
  285. static OSErr FSWriteNoCache(short refnum, long *count_p, const Ptr buffer_p)
  286.     {
  287.     OSErr retcode;
  288.     ParamBlockRec pb;
  289.     pb.ioParam.ioCompletion = 0;
  290.     pb.ioParam.ioRefNum     = refnum;
  291.     pb.ioParam.ioBuffer     = buffer_p;
  292.     pb.ioParam.ioReqCount   = *count_p;
  293.     pb.ioParam.ioPosMode    = fsAtMark | 0x20; /* don't cache */
  294.     pb.ioParam.ioPosOffset  = 0;
  295.     retcode = PBWrite(&pb, false);
  296.     *count_p = pb.ioParam.ioActCount;
  297.     return(retcode);
  298.     }
  299.  
  300. static void filetest(unsigned long block_size, short testcase)
  301.     {
  302.     long inOutCount, t1, t2, t3;
  303.     short fRefNum, i, num_blocks = FILE_SIZE / block_size;
  304.     FSDelete(filename, sysenvirons.sysVRefNum);
  305.     if (Create(filename, sysenvirons.sysVRefNum, '????', '????'))
  306.         { printf("Create failed\n"); exit(1); }
  307.     if (FSOpen(filename, sysenvirons.sysVRefNum, &fRefNum))
  308.         { printf("FSOpen failed\n"); exit(1); }
  309.     fileflusher.ioCompletion = NULL;
  310.     fileflusher.ioResult     = noErr;
  311.     fileflusher.ioRefNum     = fRefNum;
  312.     t1 = TickCount();
  313.     for (i=0; i<num_blocks; i++)
  314.         {
  315.         inOutCount = block_size;
  316.         switch (testcase)
  317.             {
  318.             case 0: FSWrite(fRefNum, &inOutCount, buffer);
  319.                     break;
  320.             case 1: FSWrite(fRefNum, &inOutCount, buffer);
  321.                     if (fileflusher.ioResult == noErr)
  322.                         PBFlushFile((ParmBlkPtr)&fileflusher, TRUE);
  323.                     break;
  324.             case 2: FSWriteNoCache(fRefNum, &inOutCount, buffer);
  325.                     break;
  326.             }
  327.         }
  328.     t2 = TickCount();
  329.     if (FSClose(fRefNum)) { printf("FSClose failed\n"); exit(1); }
  330.     t3 = TickCount();
  331.     FSDelete(filename, sysenvirons.sysVRefNum);
  332.     printf("Write:%4ld (!%2lds)  ", t2-t1, (t2-t1)/60);
  333.     printf("Close:%4ld (!%2lds)  ", t3-t2, (t3-t2)/60);
  334.     printf("Total:%4ld (!%2lds)\n", t3-t1, (t3-t1)/60);
  335.     }
  336.  
  337. static void blocktest(unsigned long block_size)
  338.     {
  339.     printf("Standard writes:    "); filetest(block_size, 0);
  340.     printf("Write and flush:    "); filetest(block_size, 1);
  341.     printf("No-cache writes:    "); filetest(block_size, 2);
  342.     }
  343.  
  344. void main(void)
  345.     {
  346.     buffer = NewPtr(MAX_BLOCK_SIZE);
  347.     if (!buffer) { printf("Not enough memory\n"); exit(1); }
  348.     SysEnvirons(curSysEnvVers, &sysenvirons);
  349.     printf("Testing Writing %ldK in various block sizes\n", FILE_SIZE / 1024);
  350.     printf("Testing 0.5K blocks\n"); blocktest( 0x200);
  351.     printf("Testing   1K blocks\n"); blocktest( 0x400);
  352.     printf("Testing   2K blocks\n"); blocktest( 0x800);
  353.     printf("Testing   4K blocks\n"); blocktest(0x1000);
  354.     printf("Testing   8K blocks\n"); blocktest(0x2000);
  355.     printf("Testing  16K blocks\n"); blocktest(0x4000);
  356.     }
  357.  
  358.  
  359. Stuart Cheshire <cheshire@cs.stanford.edu>
  360.  * <A HREF="file://brubeck.stanford.edu/www/cheshire-bio.html">WWW</A>
  361.  * Stanford Distributed Systems Group Research Assistant
  362.  * Escondido Village Resident Computer Coordinator
  363.  * Macintosh Programmer
  364.  
  365. +++++++++++++++++++++++++++
  366.  
  367. >From qsi@cnh.wlink.nl (Peter Kocourek)
  368. Date: Sun, 10 Apr 1994 15:45:39 +0100
  369. Organization: (none)
  370.  
  371. Stuart Cheshire wrote in a message on 09 Apr 94
  372.  
  373. [... test results deleted]
  374.  
  375.  SC> Notice that: 
  376.  SC> 1. With the simple writes, every block size, even 16K, incurs 
  377.  SC> a Mac-crippling ten second freeze when the file is closed. 
  378.  
  379. Actually, this depends on the size of the cache; the smaller the cache, the
  380. sooner you'll get decent performance with increasing block size. Once a certain
  381. threshold is passed (in terms of blocksize vs. cachesize), the performance will
  382. improve enormously. Unfortunately, even with just a 32K cache, you need a
  383. fairly large blocksize (I forget the exact figures). I have run similar tests
  384. with a port of the Unix iozone program, which benchmarks file system
  385. performance, and that's how I discovered the rather useless nature of the
  386. cache. I did not know about the no-cache bit, though...
  387.  
  388.  
  389. YHS:QSI!
  390.  
  391.  
  392. +++++++++++++++++++++++++++
  393.  
  394. >From whbenson@lbl.gov (Bill Benson)
  395. Date: Tue, 12 Apr 1994 15:13:52 -0800
  396. Organization: Lawrence Berkeley Lab
  397.  
  398. Does anyone know if there would be any (significant) performance gain from
  399. disabling the cache while reading? (as opposed to writing)
  400. -Bill Benson, Lawrence Berkeley Lab, whbenson@lbl.gov
  401.  
  402. +++++++++++++++++++++++++++
  403.  
  404. >From Alan_B._Harper@bmug.org (Alan B. Harper)
  405. Date: Tue, 12 Apr 94 02:04:15 PST
  406. Organization: Berkeley Macintosh Users Group
  407.  
  408. There was an interesting note by Mike Scanlin in MacTech magazine (April 1993,
  409. p. 75)
  410. about the Apple disk cache.  I can't quote the entire article, but a relevant
  411. section is
  412.  
  413. > The formula [Apple] uses to decide if any given read or write should
  414. > be cached is:
  415. >   numCacheBlocks = user-defined cache size DIV 512;
  416. >   maxCachedReadWrite = (numCacheBlocks - 1) * 16;
  417. > So with a cache size of 256K you get
  418. >     numCacheBlocks = 512;
  419. >   maxCachedReadWrite = 8176
  420. > That means that any read/write larger than 8176 bytes will not be cached.  So
  421. in
  422. > my test app [described in the article], nothing was being cached until the
  423. cache
  424. > was 384K or larger, at which time my 8K writes were being cached (and I got
  425. > a 13x performance slow-down).
  426.  
  427. Basically, this means that if your app either does its own caching, or if it
  428. writes something it knows it won't need again, always set the no-cache bit.
  429.  
  430. +++++++++++++++++++++++++++
  431.  
  432. >From peter.lewis@info.curtin.edu.au (Peter N Lewis)
  433. Date: Thu, 14 Apr 1994 16:08:37 +0800
  434. Organization: NCRPDA, Curtin University
  435.  
  436. In article <0013A0ED.fc@bmug.org>, Alan_B._Harper@bmug.org (Alan B.
  437. Harper) wrote:
  438.  
  439. >Basically, this means that if your app either does its own caching, or if it
  440. >writes something it knows it won't need again, always set the no-cache bit.
  441.  
  442. Not entirely.  Even if you know it will be read again, it is often better
  443. to disable the cache.  For example, I get better performance out of
  444. Anarchie downloading files and then feeding them to StuffIt Expander if
  445. the cache is inhibited during the download even though I know Expander
  446. will read the file as soon as I'm finished.
  447.  
  448. Basically, disable the cahce unless you are writing 10 byte blocks, and
  449. *DONT* write ten byte blocks!  If you write lots of small blocks, the
  450. FSClose time goes exponential, at least in tests I did.  Writing a 1 Meg
  451. file could end up with close times measured in minutes.
  452.    Peter.
  453. _______________________________________________________________________
  454. Peter N Lewis <peter.lewis@info.curtin.edu.au>       Ph: +61 9 368 2055
  455.  
  456. +++++++++++++++++++++++++++
  457.  
  458. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  459. Date: 16 Apr 1994 17:03:25 GMT
  460. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  461.  
  462. In article <whbenson-120494151352@twinpeaks.lbl.gov> whbenson@lbl.gov (Bill Benson) writes:
  463. >
  464. > Does anyone know if there would be any (significant) performance gain from
  465. > disabling the cache while reading? (as opposed to writing)
  466.  
  467. the simple answer is that you aren't likely to see any performance gain, and
  468. (and if do this indiscriminantly) you'll make things much worse.
  469.  
  470. when you read a chunk from the disk, if it's not in the cache, the disk
  471. _must_ be accessed.  there's no way around this, and disk accesses are
  472. slow.
  473.  
  474. of course, if the data is in the cache, then the read is quite fast.  this
  475. is the basic idea of caches - keep useful data in the cache to avoid
  476. having to access the disk.
  477.  
  478. knowing what data is going to be useful is difficult, but a few rules of
  479. thumb have proved useful:
  480.   if it was accessed recently, it is likely to be accessed again soon
  481.   if an area was accessed, the surrounding area is likely to be accessed
  482.     in the near future
  483.  
  484. thus, whenever you access the disk, cache it somewhere because you're likely
  485. to need it again. and grab a little bit more than you need, because you're
  486. likely to need that, too.
  487.  
  488. turning off the caches effectively disables this optimization.  the only
  489. time it may be useful is if you know _absolutely_ that you'll never need
  490. it again.  even then, you probably won't notice the speed benefit (since
  491. the disk access is the most significant part, and you can't avoid that).
  492.  
  493. if you load something into the cache that isn't used, it'll eventually
  494. get swapped out for useful data. it's usually not worth worrying about.
  495.  
  496.  
  497. WRT writes, turning off the cache can be useful because it _does_ "eliminate"
  498. the disk access by deferring it until later.
  499.  
  500.  
  501. hope this clears things up,
  502.  
  503.  
  504. -gary j kacmarcik
  505. platypus@cirrus.som.cwru.edu
  506.  
  507. +++++++++++++++++++++++++++
  508.  
  509. >From Cameron Esfahani <dirty@guest.apple.com>
  510. Date: Sun, 17 Apr 1994 09:20:34 GMT
  511. Organization: Apple Computer, Inc.
  512.  
  513. In article <PLATYPUS.94Apr16130325@cirrus.som.cwru.edu> Gary Kacmarcik,
  514. platypus@cirrus.som.cwru.edu writes:
  515. > knowing what data is going to be useful is difficult, but a few rules of
  516. > thumb have proved useful:
  517. >   if it was accessed recently, it is likely to be accessed again soon
  518. >   if an area was accessed, the surrounding area is likely to be accessed
  519. >     in the near future
  520. > thus, whenever you access the disk, cache it somewhere because you're likely
  521. > to need it again. and grab a little bit more than you need, because you're
  522. > likely to need that, too.
  523. > if you load something into the cache that isn't used, it'll eventually
  524. > get swapped out for useful data. it's usually not worth worrying about.
  525.  
  526. One problem with this is that you have to get the space in the
  527. cache from someplace!  Then you have to decide what information to
  528. throw out, just so you can read in this extra information which
  529. might never be used...
  530.  
  531. > WRT writes, turning off the cache can be useful because it _does_ "eliminate"
  532. > the disk access by deferring it until later.
  533.  
  534. I think you have this backwards; by turning off the cache how does
  535. that eliminate the disk access?  If anything, having a cache will
  536. eliminate the write out to disk by sticking it in the cache and
  537. deferring the write until later...
  538.  
  539. Cameron Esfahani
  540. dirty@apple.com
  541. I make things go faster...
  542.  
  543. +++++++++++++++++++++++++++
  544.  
  545. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  546. Date: 18 Apr 1994 22:21:20 GMT
  547. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  548.  
  549.  
  550. In article <1994Apr17.092034.5202@gallant.apple.com> Cameron Esfahani <dirty@guest.apple.com> writes:
  551. >
  552. > In article <PLATYPUS.94Apr16130325@cirrus.som.cwru.edu> Gary Kacmarcik,
  553. > platypus@cirrus.som.cwru.edu writes:
  554. > > 
  555. > > WRT writes, turning off the cache can be useful because it _does_ "eliminate"
  556. > > the disk access by deferring it until later
  557. >
  558. > I think you have this backwards; by turning off the cache how does
  559. > that eliminate the disk access?  If anything, having a cache will
  560. > eliminate the write out to disk by sticking it in the cache and
  561. > deferring the write until later...
  562.  
  563. whoa!  what was i smoking when i wrote that...
  564.  
  565. Cameron is, of course, correct in his correction.
  566.  
  567. -gary
  568.  
  569. +++++++++++++++++++++++++++
  570.  
  571. >From lsr@taligent.com (Larry Rosenstein)
  572. Date: Wed, 20 Apr 1994 23:07:56 GMT
  573. Organization: Taligent, Inc.
  574.  
  575. In article <peter.lewis-140494160837@rocky.curtin.edu.au>,
  576. peter.lewis@info.curtin.edu.au (Peter N Lewis) wrote:
  577.  
  578. > Basically, disable the cahce unless you are writing 10 byte blocks, and
  579. > *DONT* write ten byte blocks!  If you write lots of small blocks, the
  580. > FSClose time goes exponential, at least in tests I did.  Writing a 1 Meg
  581.  
  582. This is good advice for other reasons as well.  If the file lives on a
  583. server being accessed via ARA, then writing small-sized blocks will be
  584. extremely slow.  
  585.  
  586. -- 
  587. Larry Rosenstein
  588. Taligent, Inc.
  589.  
  590. lsr@taligent.com
  591.  
  592. +++++++++++++++++++++++++++
  593.  
  594. >From jumplong@aol.com (Jump Long)
  595. Date: 28 Apr 1994 12:51:06 -0400
  596. Organization: America Online, Inc. (1-800-827-6364)
  597.  
  598. In article <lsr-200494160756@kip-20.taligent.com>, lsr@taligent.com (Larry
  599. Rosenstein) writes:
  600.  
  601. >> Basically, disable the cahce unless you are writing 10 byte blocks, and
  602. >> *DONT* write ten byte blocks!  If you write lots of small blocks, the
  603. >> FSClose time goes exponential, at least in tests I did.  Writing a 1 Meg
  604. >
  605. > This is good advice for other reasons as well.  If the file lives on a
  606. > server being accessed via ARA, then writing small-sized blocks will be
  607. > extremely slow.  
  608.  
  609. Here's a little more information about AppleShare...
  610.  
  611. I'm not sure about AppleShare Pro and AppleShare 4.0 (I suspect it hasn't
  612. changed), but the AppleShare 3.0.x, Macintosh File Sharing and AppleShare 2.0
  613. file servers always set the noCache bit for all file access on the server
  614. system. They do that because if there are multiple users hitting multiple files
  615. on the server, any blocks cached by one user tend to be flushed by I/O by from
  616. another user.  On the AppleShare client system, the noCache bit is ignored (the
  617. AppleShare foreign file system does not use the File Manager's cache *at*
  618. *all*).  The only thing cached by the AppleShare foreign file system is entries
  619. returned by AFPEnumerate which is used to get information in response to
  620. indexed GetFInfo and GetCatInfo calls (and the cached directory entries are
  621. only kept for a very short period of time).
  622.  
  623. Since the AppleTalk Filing Protocol (AFP) is built on top of the AppleTalk
  624. Transaction Protocol (ATP), the amount of data transferred from server to
  625. client or client to server is limited to around 4K per AFP request (the maximum
  626. size of an ATP reply). Larger requests to AFP are broken up by the protocol
  627. code. For example, If you do a PBRead asking for 8K of data from a file on an
  628. AppleShare server, AFP will ask the server for 8K and will get back around 4K. 
  629. So, it will ask for the remaining 4K to finish up the request.  So, with the
  630. AppleShare 3.0.x, Macintosh File Sharing and AppleShare 2.0 file servers, the
  631. server reads everything in 4K chunks and writes everything in 4K chunks, no
  632. matter how large the requests were on the client side.
  633.  
  634. AppleShare Pro and AppleShare 4.0 improve performance dramatically by caching
  635. data on the server.  For example, if an 8K read request is received from a
  636. client, the server reads 8K into its cache and returns 4K (because of the ATP
  637. limitation).  When the AFP client asks for the remaining 4K, the server gets it
  638. from its cache which saves a hit to the disk.
  639.  
  640. So, with file access to an AppleShare volume:
  641.  
  642. o  The noCache bit in your Reads and Writes makes no difference whatsoever.
  643.  
  644. o  Using large Read and Writes from the client will improve performance -
  645. especially with AppleShare Pro and AppleShare 4.0.
  646.  
  647. -- Jim Luther
  648.  
  649.  
  650. ---------------------------
  651.  
  652. >From grantd@dcs.gla.ac.uk (Dair Grant)
  653. Subject: Extension Shell 1.3 - Help for INIT writers
  654. Date: Wed, 27 Apr 1994 16:45:51 GMT
  655. Organization: Computing Science Dept., Glasgow University, Glasgow, Scotland
  656.  
  657. Extension Shell is a library of source code for writing System 7
  658. Extensions. Full source code is provided, as well as six sample
  659. Extensions demonstrating how to write Extensions with Extension
  660. Shell.
  661.  
  662.  
  663. Extension Shell acts as an Extension-independent loading mechanism.
  664. It takes care of the generic stuff needed by all Extensions (showing
  665. icons, installing things into the System Heap, posting Notification
  666. Manager messages), and reduces the amount of coding needed to produce
  667. new Extensions.
  668.  
  669.  
  670. To write an Extension with Extension Shell, you just decide what you
  671. want installed, compile it into a code resource, and paste in
  672. Extension Shell. Trap patches, VBL tasks, Shutdown tasks, Time
  673. Manager tasks, Gestalt selectors, low-memory filters (e.g., jGNEFilter),
  674. and blocks of code can all be installed through a simple
  675. "fill out the details in a table" mechanism. It requires THINK C 6.0.
  676.  
  677.  
  678.  
  679. -dair
  680.  
  681. - -------------------+--------------------------------------------------------
  682. Dair Grant           | There are two major products that come out of Berkeley:
  683. grantd@dcs.gla.ac.uk | LSD and Unix. We don't believe this to be a
  684. Finger for PGP Key   | coincidence.                          - Jeremy Anderson
  685. - -------------------+--------------------------------------------------------
  686.  
  687. +++++++++++++++++++++++++++
  688.  
  689. >From grantd@dcs.gla.ac.uk (Dair Grant)
  690. Date: Wed, 27 Apr 1994 17:30:24 GMT
  691. Organization: Computing Science Dept., Glasgow University, Glasgow, Scotland
  692.  
  693. grantd@dcs.gla.ac.uk (Dair Grant) writes:
  694.  
  695. >Extension Shell is a library of source code for writing System 7
  696. >Extensions. Full source code is provided, as well as six sample
  697. >Extensions demonstrating how to write Extensions with Extension
  698. >Shell.
  699.  
  700.     [munch]
  701.  
  702.  
  703. Ooops. I forgot to mention that I've sent it off to macgifts. It
  704. should be showing up there within a couple of days. Too many
  705. late nights trying to get my final year project finished... :-(
  706.  
  707.  
  708.  
  709. -dair
  710.  
  711. - -------------------+--------------------------------------------------------
  712. Dair Grant           | There are two major products that come out of Berkeley:
  713. grantd@dcs.gla.ac.uk | LSD and Unix. We don't believe this to be a
  714. Finger for PGP Key   | coincidence.                          - Jeremy Anderson
  715. - -------------------+--------------------------------------------------------
  716.  
  717. ---------------------------
  718.  
  719. >From andys@nsrvan.van.wa.us
  720. Subject: FFT benchmark using CodeWarrior
  721. Date: 26 Apr 94 08:58:24 PST
  722. Organization: National Systems & Research, Vancouver WA
  723.  
  724. I ran the FFT benchmark which was posted to comp.sys.powerpc by
  725. whitney@galileo.Meakins.McGill.CA. I ran this on several computers
  726. including a PowerMac 6100/60. I compiled the program using 
  727. CodeWarrior DR2 which uses the Apple math library. I also am 
  728. including the SpecInt and SpecFP results which gsnow@clark.edu
  729. posted earlier:
  730.  
  731. these FFT results are from whitney@galileo.Meakins.McGill.CA:
  732.  
  733.                                   FFT Time     SpecInt   SpecFP
  734.  
  735.     RS6000 Model 320                 55.0       20.9      39.4
  736.     RS6000 Model 530                 41.0       28.5      64.6
  737.     RS6000 Model 250                 40.0       62.6      72.2
  738.     RS6000 Model 590                 18.0      117.0     242.4
  739.  
  740. These are the results from the tests I ran. Notice I ran with
  741. and without the compilers optimizer turned on:
  742.  
  743.     RS6000 Model 550 (Opt)           25.0       35.4      71.7
  744.     RS6000 Model 550 (No-Opt)        61.0       35.4      71.7
  745.     Decstation 5000/260 (Opt)        46.0       57.1      54.5
  746.     Decstation 5000/260 (No-Opt)     56.0       57.1      54.5
  747.     Decstation 5000/240 (Opt)        99.0       27.9      35.8
  748.     Dec3000 Alpha 300L (OVMS-Opt)    54.0       45.9      63.6
  749.     Dec3000 Alpha 300L (OVMS-NoOpt) 125.0       45.9      63.6
  750.     Dec3100/90 (VMS No-Opt)         133.0       ????      ????
  751.     Dec3100/90 (VMS Opt)            108.0       ????      ????
  752.     
  753.     PowerMac 6100/60 (No-Opt)        66.0      ~55.0     ~73.0
  754.     PowerMac 6100/60 (Opt)           65.0      ~55.0     ~73.0
  755.     PowerMac 6100/60 (Opt/double_t)  77.0      ~55.0     ~73.0
  756.  
  757. I think this is very interesting because it tells me that the
  758. CodeWarrior optimizer has a LONG way to go. Notice what the
  759. RS6000 Model 550 did using xlc with and without the optimizer.
  760. The optimizer gave a 244% speedup. The PowerMac with no optimization
  761. did almost as well as the RS6000 Model 550 without optimization.
  762. I think we have a lot to look forward to as CodeWarrior progesses!!
  763.  
  764. Another note, the FFT program uses floats, I tried to change these
  765. floats to double_t and the time came out to 77.0 with the optimizer
  766. turned on. I also tried changing the struct alignment just for
  767. the heck of it and all three settings [PowerPC, 68k, 68k 4-byte]
  768. all came out with the same times.
  769.  
  770. One more note, when I say optimizations above I meant I turned on
  771. the highest level of optimization each compiler has.
  772.  
  773.  
  774. +++++++++++++++++++++++++++
  775.  
  776. >From usenet@lowry.eche.ualberta.ca (Brian Lowry)
  777. Date: 26 Apr 1994 22:39:43 GMT
  778. Organization: Chem Eng - Univ of Alberta
  779.  
  780. In article <1994Apr26.085824.223@nsrvan.van.wa.us>, andys@nsrvan.van.wa.us
  781. wrote:
  782.  
  783. > I think this is very interesting because it tells me that the
  784. > CodeWarrior optimizer has a LONG way to go.
  785.  
  786.   I was under the impression that the DR2 CodeWarrior C compiler did not
  787. actually have optimization implemented, regardless of the project settings.
  788.  You might want to contact MetroWerks and ask them.  I haven't seen any
  789. evidence of optimization in low-level stuff...
  790.  
  791. -- 
  792.  
  793. Brian Lowry
  794.  
  795. +++++++++++++++++++++++++++
  796.  
  797. >From ameline@provence.torolab.ibm.com (Ian R. Ameline)
  798. Date: 27 Apr 1994 00:09:05 GMT
  799. Organization: C-Set++ Development, IBM Canada Laboratory.
  800.  
  801. In <1994Apr26.085824.223@nsrvan.van.wa.us>, andys@nsrvan.van.wa.us writes:
  802.  
  803. [Performance Numbers deleted]
  804.  
  805. >I think this is very interesting because it tells me that the
  806. >CodeWarrior optimizer has a LONG way to go. Notice what the
  807. >RS6000 Model 550 did using xlc with and without the optimizer.
  808.  
  809.    Well, IBM has been writing optimizing compilers for over 20 years. 
  810. I believe the current XLC optimizer has been in development for around 
  811. 10 years, with some really bright people involved with it. There 
  812. should be little surprise that we're good at this sort of thing.
  813.                                                                                   
  814. >The optimizer gave a 244% speedup. The PowerMac with no optimization
  815. >did almost as well as the RS6000 Model 550 without optimization.
  816. >I think we have a lot to look forward to as CodeWarrior progesses!!
  817.  
  818.    I've heard an unconfirmed rumour on the net that they've licenced 
  819. some IBM optimization technology. I don't know if it's true or not, 
  820. but if it is, perhaps your last sentence is correct.
  821.  
  822. Regards,                  | "Once you have flown, you will walk the earth with
  823. Ian R. Ameline, PP-ASEL   |  your eyes turned skyward, for there you have been,
  824. (speaking for myself only)|  and there you long to return" -- Leonardo DaVinci
  825. ViaCrypt PGP Key fingerprint = 3B B8 CF E9 CA 1B 9C 75  01 7F B2 64 10 7F 96 85   
  826.  
  827.  
  828. +++++++++++++++++++++++++++
  829.  
  830. >From Tigger <greg@pomona.claremont.edu>
  831. Date: Tue, 26 Apr 1994 03:45:25 GMT
  832. Organization: Pomona College
  833.  
  834. In article <2pkaf1$jo5@tornews.torolab.ibm.com> Ian R. Ameline,
  835. ameline@provence.torolab.ibm.com writes:
  836. >
  837. >    I've heard an unconfirmed rumour on the net that they've licenced 
  838. > some IBM optimization technology.
  839.  
  840. I read it in at least two different trade rags, and it was reported
  841. as news, not rumors.  I believe one of the articles included quotes
  842. from a higher-up at Metrowerks.  Sounds like more than a rumor to me.
  843.  
  844. --
  845. |  Greg Orman                         greg@pomona.claremont.edu  |
  846. |     A man's best friends:  a Harley, a Beretta and a Gund.     |
  847.  
  848. +++++++++++++++++++++++++++
  849.  
  850. >From johnmce@world.std.com (John McEnerney)
  851. Date: Wed, 27 Apr 1994 15:54:38 GMT
  852. Organization: The World Public Access UNIX, Brookline, MA
  853.  
  854. >Another note, the FFT program uses floats, I tried to change these
  855. >floats to double_t and the time came out to 77.0 with the optimizer
  856. >turned on.
  857.  
  858. On the PowerPC, 'float' is usually faster than 'double', particularly 
  859. with multiply/divide instructions.
  860.  
  861. >The PowerMac with no optimization
  862. >did almost as well as the RS6000 Model 550 without optimization.
  863.  
  864. This is definitely attributable to the 550 being faster. When 
  865. optimizations are turned off, CodeWarrior handily outperforms xlc (xlc 
  866. makes little use of registers when optimization is turned off)
  867.  
  868. >I think we have a lot to look forward to as CodeWarrior progesses!!
  869.  
  870. The current version so CodeWarrior actually do almost no optimization 
  871. beyond global register allocation. This can make some programs faster, 
  872. but because of the plentiful registers on the PowerPC it does not make an 
  873. improvement in many cases. Future versions wil include all of 
  874. the usual optimizations.
  875.  
  876. -- John
  877.  
  878.  
  879. +++++++++++++++++++++++++++
  880.  
  881. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  882. Date: 27 Apr 1994 19:48:49 GMT
  883. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  884.  
  885. In article <A9E32DE57E0104A7@taz.claremont.edu> Tigger <greg@pomona.claremont.edu> writes:
  886. >
  887. > In article <2pkaf1$jo5@tornews.torolab.ibm.com> Ian R. Ameline,
  888. > ameline@provence.torolab.ibm.com writes:
  889. > >
  890. > >    I've heard an unconfirmed rumour on the net that they've licenced 
  891. > > some IBM optimization technology.
  892. >
  893. > I read it in at least two different trade rags, and it was reported
  894. > as news, not rumors.  I believe one of the articles included quotes
  895. > from a higher-up at Metrowerks.  Sounds like more than a rumor to me.
  896.  
  897. John McEnerey (from Metrowerks) attempted to clarify the articles that
  898. were published.  these articles implied that Metrowerks has licensed
  899. some of IBM's code.  this is not the case.
  900.  
  901. included is an excerpt from John's original post.
  902.  
  903. -gary
  904.  
  905.  
  906. [QUOTED MESSAGE FOLLOWS]
  907.  
  908. Newsgroups: comp.sys.mac.programmer
  909. Path: usenet.ins.cwru.edu!eff!news.kei.com!world!johnmce
  910. From: johnmce@world.std.com (John McEnerney)
  911. Subject: Re: Metrowerks News from MacWEEK
  912. Message-ID: <CnzIH7.FoC@world.std.com>
  913. Organization: The World Public Access UNIX, Brookline, MA
  914. References: <Cnz0JL.5v9@zcias2.ziff.com> <9404090108.AA09272@geweke.ppp.msu.edu>
  915. Date: Sat, 9 Apr 1994 09:03:06 GMT
  916. Lines: 44
  917.  
  918. > Metrowerks has formed an agreement with IBM which gives Metrowerks 
  919. > access to Big Blue's compiler optimization technology for current and 
  920. > future PowerPC processors. As a result, Mac developers will have access 
  921. > to the best PowerPC code generators available, said Jean Belanger, 
  922. > Metrowerks' chairman. "In addition to having the fastest compiler, we'
  923. > ll be able to generate the fastest code," he said. 
  924.  
  925. So that the rumours don't fly to far too fast on this one, let me clarify 
  926. the situation as it will affect you, the users.
  927.  
  928. We have an agreement which says that as I develop the next version 
  929. of our PowerPC code generator, I'm free to ask for advice, experiences, 
  930. etc. from some of the guys at IBM's Watson Research Center where the 
  931. POWER architecture was originally designed. It turns out much of my 
  932. current code generator design is already based on some papers that they 
  933. wrote at Watson anyway. They are willing to be pretty free with their 
  934. experience, but I imagine they will also keep some tricks to themselves.
  935.  
  936. No source code is involved, at least not to my knowledge.
  937.  
  938. [... rest deleted ...]
  939.  
  940.  
  941.  
  942. +++++++++++++++++++++++++++
  943.  
  944. >From zstern@adobe.com (Zalman Stern)
  945. Date: Wed, 27 Apr 1994 21:59:22 GMT
  946. Organization: Adobe Systems Incorporated
  947.  
  948. John McEnerney writes
  949. > This is definitely attributable to the 550 being faster. When 
  950. > optimizations are turned off, CodeWarrior handily outperforms xlc (xlc 
  951. > makes little use of registers when optimization is turned off)
  952.  
  953. I've observed that if you have debugging information turned on and  
  954. optimization turned off, xlc goes out of its way to generate *exactly* the  
  955. seqeunce of operations you wrote in your program. This means that variables  
  956. are "homed" to their memory locations at the end of each line of code if  
  957. they are modified. Variables also seem to be preserved as live to the end of  
  958. their declared scope. The result of these things is a rather inefficient but  
  959. easy to debug program. I never compile with both optimization and debug  
  960. symbols off so I don't know if this is a property of turning optimization  
  961. off, or a property of turning debugging on with optimization off.
  962. --
  963. Zalman Stern           zalman@adobe.com            (415) 962 3824
  964. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  965.           There is no lust like the present.
  966.  
  967. +++++++++++++++++++++++++++
  968.  
  969. >From whitney@galileo.Meakins.McGill.CA ()
  970. Date: Thu, 28 Apr 1994 02:40:14 GMT
  971. Organization: McGill University
  972.  
  973. andys@nsrvan.van.wa.us wrote:
  974. : I ran the FFT benchmark which was posted to comp.sys.powerpc by
  975. : whitney@galileo.Meakins.McGill.CA. I ran this on several computers
  976. : including a PowerMac 6100/60.
  977.  
  978. : I think this is very interesting because it tells me that the
  979. : CodeWarrior optimizer has a LONG way to go. 
  980.  
  981. I have also draw this conclusion, but this well known.
  982. One has be careful on what conclusions one draws from this simple
  983. benchmark. My intention was to use it as sanity check against
  984. the numbers I have in magazines and on the net. The benchmark
  985. was intended to simulate the number crunching efforts of researchers
  986. in our respiratory research lab. We have data sets that usually
  987. larger than most caches so I included that in my benchmark. Those
  988. that takes benchmarks seriously would say that this makes the benchmark
  989. meaningless and that it does little more than detect the presence
  990. or absence of a 512 K cache. ( Perhaps it is the case that all our
  991. research efforts amount to little more than detecting 512K caches :-) )
  992. Of course, running code in a memory bound fashion tends to diminish the 
  993. advantage of the super-scalar designs particularly more sophisticated
  994. designs such as the POWER2 machines ( as seen the benchmarks ).
  995.  
  996. Furthermore the fft implementation is a very simple one. It has
  997. not been reworked for data that exceeds the cache size. Again 
  998. this was deliberate on my part. More often than not we use simple
  999. coding techniques. 
  1000.  
  1001. : One more note, when I say optimizations above I meant I turned on
  1002. : the highest level of optimization each compiler has.
  1003.  
  1004. I used cc -O only because we may move binaries from
  1005. machine to machine - perhaps from the RS6000 to the PowerMac.
  1006.  
  1007. Whitney
  1008.  
  1009. +++++++++++++++++++++++++++
  1010.  
  1011. >From 103t_english@west.cscwc.pima.edu
  1012. Date: 27 Apr 94 23:06:02 MST
  1013. Organization: (none)
  1014.  
  1015. In article <A9E32DE57E0104A7@taz.claremont.edu>, Tigger <greg@pomona.claremont.edu> writes:
  1016. > In article <2pkaf1$jo5@tornews.torolab.ibm.com> Ian R. Ameline,
  1017. > ameline@provence.torolab.ibm.com writes:
  1018. >>
  1019. >>    I've heard an unconfirmed rumour on the net that they've licenced 
  1020. >> some IBM optimization technology.
  1021. > I read it in at least two different trade rags, and it was reported
  1022. > as news, not rumors.  I believe one of the articles included quotes
  1023. > from a higher-up at Metrowerks.  Sounds like more than a rumor to me.
  1024. > --
  1025. > |  Greg Orman                         greg@pomona.claremont.edu  |
  1026. > |     A man's best friends:  a Harley, a Beretta and a Gund.     |
  1027.  
  1028.  
  1029.  
  1030. On AOL, the architect of the CodeWarrior C/C++ came out and clarified issues.
  1031. He won't be able to do much until next year at the earliest...
  1032.  
  1033. Lawson
  1034.  
  1035. +++++++++++++++++++++++++++
  1036.  
  1037. >From johnmce@world.std.com (John McEnerney)
  1038. Date: Thu, 28 Apr 1994 06:24:57 GMT
  1039. Organization: The World Public Access UNIX, Brookline, MA
  1040.  
  1041. usenet@lowry.eche.ualberta.ca (Brian Lowry) writes:
  1042.  
  1043. >  I was under the impression that the DR2 CodeWarrior C compiler did not
  1044. >actually have optimization implemented, regardless of the project settings.
  1045. > You might want to contact MetroWerks and ask them.  I haven't seen any
  1046. >evidence of optimization in low-level stuff...
  1047.  
  1048. The DR2 and DR3 versions of CodeWarrior (for PowerPC) have no real 
  1049. optimizations. I use the Global Optimization option as a catch-all for 
  1050. anything that is likely to slow down the compiler. For now, it only 
  1051. controls global register allocation. This does quite a nice job of 
  1052. cleaning up your register usage (for example, variables with disjoint 
  1053. lifetimes will get the same register, and it does a pretty good job with 
  1054. function calls) but usually does not provide a significant performance 
  1055. increase because there are so many registers on the PowerPC.
  1056.  
  1057. Although this is not a huge optimization, the algorithm is O(N^2) so it 
  1058. tends to slow the compiler down quite a bit, which is why the smart 
  1059. register allocator isn't used all the time.
  1060.  
  1061. DR4 will probably add some common subexpression elimination.
  1062.  
  1063. Future versions will add the traditional global optimizations, which will 
  1064. slow down the compiler quite a bit more when they are enabled.
  1065.  
  1066. -- John McEnerney, Metrowerks PowerPC Product Architect
  1067.  
  1068.  
  1069. ---------------------------
  1070.  
  1071. >From rjc@crosfield.co.uk (Roger Clark)
  1072. Subject: How do I find the window colour ???
  1073. Date: Thu, 28 Apr 1994 11:05:40 GMT
  1074. Organization: Crosfield, Hemel Hempstead, UK
  1075.  
  1076. Hi,
  1077.    I'm trying to find out what "Window colour" has been set by the "Colour" 
  1078. control panel.  I have tried using GetAuxWin(nil,&theAuxWinHandle); in
  1079. an attempt to get the "default" window information, but this gives colours
  1080. of black or white (0xffff,0xffff,0xffff or 0x0,0x0,0x0) for the various
  1081. components (like content,frame,text,highlight and title bar).
  1082.  
  1083. Does anyone know what I'm doing wrong, or have a better solution.
  1084.  
  1085.  
  1086. Thanks in advance.
  1087.             Roger Clark.
  1088.  
  1089. +++++++++++++++++++++++++++
  1090.  
  1091. >From Carl R. Osterwald <carl_osterwald@nrel.gov>
  1092. Date: Thu, 28 Apr 94 17:10:45 GMT
  1093. Organization: National Renewable Energy Laboratory
  1094.  
  1095. In article <1994Apr28.110540.5738@crosfield.co.uk> Roger Clark,
  1096. rjc@crosfield.co.uk writes:
  1097. >   I'm trying to find out what "Window colour" has been set by the
  1098. "Colour" 
  1099. >control panel.  I have tried using GetAuxWin(nil,&theAuxWinHandle); in
  1100. >an attempt to get the "default" window information, but this gives
  1101. colours
  1102. >of black or white (0xffff,0xffff,0xffff or 0x0,0x0,0x0) for the various
  1103. >components (like content,frame,text,highlight and title bar).
  1104.  
  1105. Two items on ftp.apple.com should give you the information you require:
  1106.  
  1107.   *  Tech Note TB 33 - "Color, Windows and 7.0"
  1108.   *  DTS code snippet "WDEFColorSample"
  1109.  
  1110. +++++++++++++++++++++++++++
  1111.  
  1112. >From devon_hubbard@taligent.com (Devon Hubbard)
  1113. Date: Thu, 28 Apr 1994 17:32:40 GMT
  1114. Organization: Taligent, Inc.
  1115.  
  1116. In article <1994Apr28.110540.5738@crosfield.co.uk>, rjc@crosfield.co.uk
  1117. (Roger Clark) wrote:
  1118.  
  1119. > Hi,
  1120. >    I'm trying to find out what "Window colour" has been set by the "Colour" 
  1121. > control panel.  I have tried using GetAuxWin(nil,&theAuxWinHandle); in
  1122. > an attempt to get the "default" window information, but this gives colours
  1123. > of black or white (0xffff,0xffff,0xffff or 0x0,0x0,0x0) for the various
  1124. > components (like content,frame,text,highlight and title bar).
  1125. > Does anyone know what I'm doing wrong, or have a better solution.
  1126. > Thanks in advance.
  1127. >             Roger Clark.
  1128.  
  1129. Have you seen Infinity Windoid yet?  He supports the floating window being
  1130. the color that the system has assigned and, giving full credit here to Troy
  1131. Gaul, here's how he does it.
  1132.  
  1133. - ---
  1134. static void 
  1135. GetWctbColor(WindowPeek window, short partCode, RGBColor *theColor) {
  1136.     //    Given a partCode, return the RGBColor associated with it. (Using the
  1137.     //    default window color table.)
  1138.     AuxWinHandle awHndl;
  1139.     short count;
  1140.     
  1141.     //    Get the Color table for the window if it has one.
  1142.  
  1143.     (void) GetAuxWin((WindowPtr) window, &awHndl); 
  1144.     count = (**(WCTabHandle) ((**awHndl).awCTable)).ctSize;
  1145.     
  1146.  
  1147.     //    If the table didn't contain the entry of interest, look to the 
  1148.     //    default table.
  1149.     
  1150.     if (count < partCode) {
  1151.         GetAuxWin(nil, &awHndl); 
  1152.         count = (**(WCTabHandle) ((**awHndl).awCTable)).ctSize;
  1153.     }
  1154.             
  1155.  
  1156.     //    If the entry is there, use it, if not make a best guess at a default
  1157. value.
  1158.  
  1159.     if (count < partCode)
  1160.         UseDefaultColor(partCode, theColor);
  1161.     else
  1162.         *theColor = (**(WCTabHandle)
  1163. ((**awHndl).awCTable)).ctTable[partCode].rgb;
  1164. }
  1165. - ----
  1166.  
  1167. You might want to get his cool Infinity Windoid archive from your nearest
  1168. site so you can see everything he's doing.
  1169.  
  1170. - ------------------------------------------------------------------------
  1171. Devon Hubbard                                                Silicon Pilot
  1172. devon_hubbard@taligent.com                                   Taligent, Inc
  1173.  
  1174. ---------------------------
  1175.  
  1176. >From tonym@netcom.com (Tony Mann)
  1177. Subject: Private inheritance faulty in SC++ 7.0
  1178. Date: Wed, 27 Apr 1994 21:58:51 GMT
  1179. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1180.  
  1181. Using SC++ 7.0, the following code should not compile, but it does:
  1182.  
  1183. class Bag
  1184. {
  1185. public:
  1186.   Bag();
  1187.   int GetCount() { return count; }
  1188. private:
  1189.   int count;
  1190. };
  1191.  
  1192. class Set: private Bag  // note "private" keyword
  1193. {
  1194. public:
  1195.   Set();
  1196. };
  1197.  
  1198. int foo(Bag& b)
  1199. {
  1200.   return b.GetCount();
  1201. }
  1202.  
  1203. main()
  1204. {
  1205.   Bag *b = new Set;     // ** should generate error; it does not
  1206.   Set s;
  1207.   foo(s);               // ** should generate error; it does not
  1208.   return 0;
  1209. }
  1210.  
  1211. The compiler is allowing a Set to be implicitly converted to a Bag;
  1212. this should not be allowed, since Set privately inherits from Bag.
  1213.  
  1214. Symantec has been notified.
  1215.  
  1216. - Tony Mann
  1217.  
  1218. ---------------------------
  1219.  
  1220. >From David Plumpton <plumpto@bnr.ca>
  1221. Subject: Source Control Questions
  1222. Date: Tue, 19 Apr 1994 03:12:09 GMT
  1223. Organization: NorTel
  1224.  
  1225. Are there any real alternatives to using MPW projector?
  1226. If you had to manage a multiplatform project using Macintosh,
  1227. Unix and Windows, which source control system on which
  1228. platform would you choose?
  1229.  
  1230. Thanks in advance.
  1231. - -----------
  1232. David Plumpton: plumpto@bnr.ca
  1233. "I'm a New Zealand Zoo Official, and this monkey's going to Newton!"
  1234.  
  1235. +++++++++++++++++++++++++++
  1236.  
  1237. >From rgc3679@halcyon.halcyon.com (Bob Carpenter)
  1238. Date: 20 Apr 1994 19:42:23 GMT
  1239. Organization: A World of Information at Your Fingertips
  1240.  
  1241. In article <1994Apr19.031209.7354@bnr.ca>,
  1242. David Plumpton  <plumpto@bnr.ca> wrote:
  1243. >Are there any real alternatives to using MPW projector?
  1244. >If you had to manage a multiplatform project using Macintosh,
  1245. >Unix and Windows, which source control system on which
  1246. >platform would you choose?
  1247. >
  1248.  
  1249.  I'd use SCCS under Unix. It's fairly powerful, and with scripts
  1250.  you can tailor it to your liking.
  1251.  
  1252.  See the sccs man pages for the details.
  1253.  
  1254. --BobC
  1255.  
  1256. +++++++++++++++++++++++++++
  1257.  
  1258. >From sw@network-analysis-ltd.co.uk (Sak Wathanasin)
  1259. Date: Thu, 21 Apr 94 09:52:55 GMT
  1260. Organization: Network Analysis Ltd
  1261.  
  1262.  
  1263. In article <2p40iv$d1f@nwfocus.wa.com> (comp.sys.mac.programmer), rgc3679@halcyon.halcyon.com (Bob Carpenter) writes:
  1264. > In article <1994Apr19.031209.7354@bnr.ca>,
  1265. > David Plumpton  <plumpto@bnr.ca> wrote:
  1266. > >Are there any real alternatives to using MPW projector?
  1267. > >If you had to manage a multiplatform project using Macintosh,
  1268. > >Unix and Windows, which source control system on which
  1269. > >platform would you choose?
  1270. > >
  1271. >  I'd use SCCS under Unix. It's fairly powerful, and with scripts
  1272. >  you can tailor it to your liking.
  1273.  
  1274. You cannot be serious: the contortions you have to go through just to
  1275. mark a set of versions as belonging to a particular release! (Yes, I
  1276. know about the
  1277.  
  1278.     what prog > prog.slist
  1279.  
  1280. trick :-()
  1281.  
  1282. Anyway, I've just come off a Windows/Mac project straight into another one, so
  1283. the issue is very much on my mind. The main problems with using a non-Mac source
  1284. control system are
  1285.  
  1286. a) filename lengths
  1287.  
  1288. For the first project, we used PVCS on a PC-compatible. Using LAN Mgr for
  1289. the Mac, we mounted the PC vols on the Mac desktop, and saved our src files
  1290. there. We then hopped on to a PC to check stuff in and out. Even though LAN
  1291. Mgr lets you use full Mac filenames, when we came to use PVCS we discovered
  1292. very quickly that we had to use 8.3 filenames. That meant chasing through
  1293. all our makefiles, .r files &c - bugs from which are still haunting me (some
  1294. of the files, like .r files only get rebuilt very occasionally).
  1295.  
  1296. b) they destroy the Mac rez fork
  1297.  
  1298. I knew that we couldn't save rsrc files in PVCS, so I had a couple of small
  1299. MPW scripts that derez'ed rsrc files before saving them on the PC volume.
  1300. Well, that worked, but we then found that when we checked stuff back out of
  1301. PVCS that we had lost all our tab settings, font settings, and most important,
  1302. our MPW markers in every source file. (Sound of grinding teeth...)
  1303.  
  1304. My current project uses SCCS, and we are going to have similar problems.
  1305. Anyway, the last time this subject came up, Tom Emerson of Symantec pointed
  1306. me at
  1307.  
  1308.       SourceSafe by
  1309.           OneTree Software
  1310.           P.O. Box 11639
  1311.           Raleigh, NC 27604
  1312.           USA
  1313.  
  1314.           (919)-821-2300
  1315.           fax (919)-821-5222
  1316.  
  1317. I didn't get a chance to follow this up, though I will do this time (promise,
  1318. really, honest :-).
  1319.  
  1320. Another possiblility you might like to look at is RCS - there is a Mac port
  1321. by Tim Endres, available from nic.switch.ch or ftp.msen.com (in /pub/vendors/ice).
  1322. Please report any experiences with this, especially if you've used it on a
  1323. real project.
  1324.  
  1325. Actually, I quite like Projector, especially when backed up with suitable MPW
  1326. scripts (look for DTS Goodies on a developer CD). I don't see why it can't
  1327. be used for storing Unix and Windows src files, since Projector, unlike SCCS
  1328. can hold binary files.
  1329.  
  1330.  
  1331. Sak Wathanasin
  1332. Network Analysis Limited
  1333. 178 Wainbody Ave South, Coventry CV3 6BX, UK
  1334.  
  1335. Internet: sw@network-analysis-ltd.co.uk 
  1336. uucp:     ...!uknet!nan!sw                       AppleLink: NAN.LTD
  1337. Phone: (+44) 203 419996 Mobile:(+44) 850 587411  Fax: (+44) 203 690690
  1338.  
  1339. +++++++++++++++++++++++++++
  1340.  
  1341. >From xxx (Christoph Reichenberger)
  1342. Date: Mon, 25 Apr 1994 07:10:27 GMT
  1343. Organization: Uni Software Plus
  1344.  
  1345. In article <2p40iv$d1f@nwfocus.wa.com>, rgc3679@halcyon.halcyon.com (Bob
  1346. Carpenter) wrote:
  1347.  
  1348. > In article <1994Apr19.031209.7354@bnr.ca>,
  1349. > David Plumpton  <plumpto@bnr.ca> wrote:
  1350. > >Are there any real alternatives to using MPW projector?
  1351. > >If you had to manage a multiplatform project using Macintosh,
  1352. > >Unix and Windows, which source control system on which
  1353. > >platform would you choose?
  1354. > >
  1355.  
  1356. Voodoo (the name stands for Versions Of Outdated Documents Organized
  1357. Orthogonally) is a (Mac) version management tool for the simple and clear
  1358. management of projects in which files are created in numerous versions
  1359. (variants and revisions). Since Voodoo is capable of managing
  1360. arbitrary files, the program can be employed for more than just the
  1361. organization of software projects in a narrow sense (program
  1362. development). Even the writing of a book, for example, is a project in
  1363. which multiple elementary building blocks (the individual chapters,
  1364. illustrations, etc.) evolve in various revisions. Using Voodoo can
  1365. also pay off here.
  1366.  
  1367. Voodoo allows both variant and revision control, and it
  1368. manages not only variants and revisions of single files, but
  1369. of a whole software project (multi files, multi users,
  1370. multi variants, access rights, ...).
  1371.  
  1372. The tool offers a neat graphical user interface and is not only
  1373. suitable for mere source code control but can handle all
  1374. different kinds of files with amazing compression rates:
  1375.  
  1376.           typical size of delta between arbitrary files
  1377.                5% (in words:  five per cent)  !!!!
  1378.  
  1379. no matter whether the files are plain text or any other
  1380. documents - e. g. MSWord, WriteNow, Canvas, FileMaker ...).
  1381. Contrary, if you try to manage non-text-files with Projector
  1382. or SCCS you will not get any space reduction.
  1383.  
  1384. Voodoo differs from previous source code control systems in its
  1385. orthogonal approach to version management. This means that for
  1386. every component of a project hierarchy you can not only store
  1387. its revision history but also different variants of the same
  1388. component.The orthogonal organization of revisions and
  1389. variants leads to a much clearer organization that with other
  1390. RCS/SCCS-based tools like Projector/SourceServer and others.
  1391.  
  1392. A lite version of Voodoo is being distributed on a shareware basis (30 $).
  1393. The package included contains VoodooLite 1.5 together with a
  1394. readme document and a manual.
  1395.  
  1396. You can get the current version directly from our ftp-server at:
  1397.   ftp.swe.uni-linz.ac.at    in /pub/voodoo
  1398.  
  1399. Additionally it should be available via ftp at least at the
  1400. following sites:
  1401.   sumex-aim.stanford.edu    in /info-mac/dev
  1402.   mac.archive.umich.edu     in /mac/util/organization
  1403.  
  1404. The full (commercial) version of Voodoo is being distributed
  1405. world-wide by:
  1406.  
  1407.    UNI Software Plus
  1408.    Softwarepark Hagenberg
  1409.    A-4232 Hagenberg
  1410.    AUSTRIA (Europe)
  1411.    Fax.: +43 (7236) 37 69
  1412.    EMail: voodoo@unisoft.co.at
  1413.  
  1414. For further information on Voodoo Lite or on the full version
  1415. please contact the author:
  1416.  
  1417.     Christoph Reichenberger      Tel:      +43-7262-2166
  1418.                  Erlenweg 2      Fax:      +43-7236-3338-30
  1419.        A-4320 Perg, Austria      Internet: chrei@unisoft.co.at
  1420.                                                                                     
  1421.  
  1422. Feel free to contact me, if you have further questions concerning Voodoo.
  1423.  
  1424. Christoph, the author of Voodoo
  1425.  
  1426.  
  1427. +++++++++++++++++++++++++++
  1428.  
  1429. >From hoshi@sra.co.jp (Hoshi Takanori)
  1430. Date: 27 Apr 94 11:34:50
  1431. Organization: Software Research Associates, Inc.,Japan
  1432.  
  1433. In article <1994Apr19.031209.7354@bnr.ca> David Plumpton <plumpto@bnr.ca> writes:
  1434.  
  1435. > Are there any real alternatives to using MPW projector?
  1436. > If you had to manage a multiplatform project using Macintosh,
  1437. > Unix and Windows, which source control system on which
  1438. > platform would you choose?
  1439.  
  1440. I've just started using RCS on my MacMiNT.  It's great!
  1441.  
  1442. hoshi
  1443.  
  1444. ---------------------------
  1445.  
  1446. >From Ken Prehoda <kenp@nmrfam.wisc.edu>
  1447. Subject: Using xlc to generate PowerMacintosh code
  1448. Date: 15 Apr 1994 00:36:24 GMT
  1449. Organization: Univ of Wisc-Madison
  1450.  
  1451. I have access to an RS/6000 with the xlc compiler.  My
  1452. question is how do I use this compiler to generate
  1453. code for the mac.  Could someone with experience in
  1454. this area please give me some pointers?
  1455.  
  1456. Thanks,
  1457. Ken Prehoda
  1458. kenp@nmrfam.wisc.edu
  1459.  
  1460. +++++++++++++++++++++++++++
  1461.  
  1462. >From creiman@netcom.com (Charlie Reiman)
  1463. Date: Fri, 15 Apr 1994 07:15:24 GMT
  1464. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1465.  
  1466. Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1467.  
  1468. >I have access to an RS/6000 with the xlc compiler.  My
  1469. >question is how do I use this compiler to generate
  1470. >code for the mac.  Could someone with experience in
  1471. >this area please give me some pointers?
  1472.  
  1473. You can't, really. The xlc that apple is giving to developers is
  1474. modified to support the pascal keyword (ignored), #pragma align=68k
  1475. (very important), and pascal strings (also important). Also, their xlc
  1476. generates instructions for the PowerPC which probably isn't an option
  1477. on older versions of xlc.
  1478.  
  1479. If you don't need any of these, then you can generate .o files, then
  1480. drop those into an MPW development environment and use the usual
  1481. makepef, ppclink, et al. If you can get the inside track SDK, it's
  1482. actually pretty cool (if you are an unix hacker, anyway).  I've
  1483. always wanted to cross compile my mac apps under unix. Now, I can.
  1484.  
  1485. -- 
  1486. "You can't cancel the project! We already made the T-shirts!"
  1487. Charlie Reiman
  1488. creiman@netcom.com
  1489.  
  1490. +++++++++++++++++++++++++++
  1491.  
  1492. >From mgleason@cse.unl.edu (Mike Gleason)
  1493. Date: 15 Apr 1994 11:13:39 GMT
  1494. Organization: NCEMRSoft
  1495.  
  1496. creiman@netcom.com (Charlie Reiman) writes:
  1497.  
  1498. |Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1499. |>I have access to an RS/6000 with the xlc compiler. My question is how
  1500. |>do I use this compiler to generate code for the mac. Could someone with
  1501. |>experience in this area please give me some pointers?
  1502.  
  1503. |You can't, really. The xlc that apple is giving to developers is
  1504. |modified to support the pascal keyword (ignored), #pragma align=68k
  1505. |(very important), and pascal strings (also important). Also, their xlc
  1506. |generates instructions for the PowerPC which probably isn't an option
  1507. |on older versions of xlc.
  1508.  
  1509. Too bad... one could write a preprocessor that could handle the 'pascal'
  1510. and pascal strings, then use that before the cpp for xlc.  Can't get
  1511. around the #pragma align=68k or PowerPC generation, though.
  1512.  
  1513. |If you don't need any of these, then you can generate .o files, then
  1514. |drop those into an MPW development environment and use the usual
  1515. |makepef, ppclink, et al. If you can get the inside track SDK, it's
  1516. |actually pretty cool (if you are an unix hacker, anyway).  I've
  1517. |always wanted to cross compile my mac apps under unix. Now, I can.
  1518.  
  1519. Me too.  One thing I did just figure out how to do, which has nothing
  1520. to do with PowerPC, is send my mac code over to a unix box and run
  1521. lint on it, or actually "compile" my mac code with gcc for sole purpose
  1522. of seeing all the cool warnings it spews.  Seems kind of silly, but
  1523. the only mac compiler I can use right now is Think C 5, which doesn't
  1524. give me warning messages.
  1525.  
  1526. --
  1527. --mg                                                      mgleason@cse.unl.edu
  1528.  
  1529. +++++++++++++++++++++++++++
  1530.  
  1531. >From Ken Prehoda <kenp@nmrfam.wisc.edu>
  1532. Date: 15 Apr 1994 14:58:51 GMT
  1533. Organization: Univ of Wisc-Madison
  1534.  
  1535. <creimanCoAHHp.C90@netcom.com> Charlie Reiman, creiman@netcom.com writes:
  1536. >You can't, really. The xlc that apple is giving to developers is
  1537. >modified to support the pascal keyword (ignored), #pragma align=68k
  1538. >(very important), and pascal strings (also important). Also, their xlc
  1539. >generates instructions for the PowerPC which probably isn't an option
  1540. >on older versions of xlc.
  1541.  
  1542. Thanks for the info.  The version of xlc that I have will 
  1543. align=68k and will also generate instructions for the 601.
  1544. Also, I can get rid of the pascal keyword easy enough.  
  1545. In other words, I think I can get it to do all of the things
  1546. that you say.  However, is it possible to compile a complete
  1547. mac application on the RS/6000 (i.e. I don't have MPW)?
  1548.  
  1549.  
  1550. >If you don't need any of these, then you can generate .o files, then
  1551. >drop those into an MPW development environment and use the usual
  1552. >makepef, ppclink, et al. If you can get the inside track SDK, it's
  1553. >actually pretty cool (if you are an unix hacker, anyway).  I've
  1554. >always wanted to cross compile my mac apps under unix. Now, I can.
  1555.  
  1556. Me too.  And that's the main reason I'm even bothering with all this.
  1557. Not to mention how much I like xlc.
  1558.  
  1559. Thanks again,
  1560. Ken Prehoda
  1561. kenp@nmrfam.wisc.edu
  1562.  
  1563. +++++++++++++++++++++++++++
  1564.  
  1565. >From proth@toto.cs.uiuc.edu (Phil Roth)
  1566. Date: Fri, 15 Apr 1994 16:10:22 GMT
  1567. Organization: Picasso Group, DCS, University of Illinois, Urbana-Champaign
  1568.  
  1569. In article <2olst3$9oi@crcnis1.unl.edu>, mgleason@cse.unl.edu (Mike Gleason) writes:
  1570. |> creiman@netcom.com (Charlie Reiman) writes:
  1571. |> 
  1572. |> |Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1573. |> |>I have access to an RS/6000 with the xlc compiler. My question is how
  1574. |> |>do I use this compiler to generate code for the mac. Could someone with
  1575. |> |>experience in this area please give me some pointers?
  1576. |> 
  1577. |> |You can't, really. The xlc that apple is giving to developers is
  1578. |> |modified to support the pascal keyword (ignored), #pragma align=68k
  1579. |> |(very important), and pascal strings (also important). Also, their xlc
  1580. |> |generates instructions for the PowerPC which probably isn't an option
  1581. |> |on older versions of xlc.
  1582. |> 
  1583. |> Too bad... one could write a preprocessor that could handle the 'pascal'
  1584. |> and pascal strings, then use that before the cpp for xlc.  Can't get
  1585. |> around the #pragma align=68k or PowerPC generation, though.
  1586.  
  1587.  
  1588. The last version of xlc I installed on our research RS/6000 supposedly
  1589. has PowerPC code generation support ( using -qarch=ppc ).
  1590. The man page claims that it will
  1591.  
  1592.     "Produce an object that contains instructions that will
  1593.     run on any of the 32-bit PowerPC hardware platforms."
  1594.  
  1595. Also, one can specify an alignment option for aligning structs and unions.
  1596. The choices are 'power' for the POWER architecture, 'twobyte' for two
  1597. byte alignment, and 'packed' for one byte alignment.
  1598. How would this relate to the 'align=68k' pragma discussed above?
  1599.  
  1600. Pascal strings would be an interesting addition, nevertheless.
  1601.  
  1602. Phil Roth
  1603. proth@cs.uiuc.edu
  1604.  
  1605.  
  1606. +++++++++++++++++++++++++++
  1607.  
  1608. >From zstern@adobe.com (Zalman Stern)
  1609. Date: Fri, 15 Apr 1994 10:15:09 GMT
  1610. Organization: Adobe Systems Incorporated
  1611.  
  1612. Ken Prehoda <kenp@nmrfam.wisc.edu> writes
  1613. > I have access to an RS/6000 with the xlc compiler.  My
  1614. > question is how do I use this compiler to generate
  1615. > code for the mac.  Could someone with experience in
  1616. > this area please give me some pointers?
  1617.  
  1618. Both Metrowerks and Apple's Macintosh on RISC SDK will accept XCOFF object  
  1619. files from the RS/6000. And if you have the very latest version of IBM's  
  1620. compilers, you should be able to compile with the Universal headers. (I  
  1621. believe Charlie Reiman's comment that the Mac specific features are not in  
  1622. the shipping version of IBM's compiler is incorrect.) You'll likely need to  
  1623. muck with the xlc configuration though. You can either do this by hand  
  1624. feeding in a bunch of flags on the command line, or by making a custom  
  1625. xlc.cfg file. (Which is only slightly more fun than smacking yourself in the  
  1626. head with an axe repeatedly.) The important compiler options you'll need  
  1627. are:
  1628.  
  1629. -qmacpstr -qpascal -qenum=small -qcpluscmt -qldbl128 -qchars=signed  
  1630. -D__powerc=1 -Dpowerc=1 -DUSE68KINLINES=0 -U_AIX
  1631.  
  1632. You'll need a -I directive pointing to the Universal headers somewhere on  
  1633. your AIX box. (Unless the code doesn't rely on Macintosh interfaces in which  
  1634. case its a lot easier. For example if you just have some computation  
  1635. intensive routines you want to compile.) You might also want to add a  
  1636. -qNOSTDINC to tell xlc not to search the standard system include  
  1637. directories.
  1638.  
  1639. You can link on the AIX box as well if you have the right libraries, which  
  1640. can probably be snagged off Apple's SDK. You'll have to move the XCOFF  
  1641. result over to a Mac and run makepef in MPW. Optionally, it may be easier to  
  1642. haul the .o files over to your Mac (being sure to use a binary transfer  
  1643. method that preserves every last bit in its pristine natural form) and use  
  1644. Apple's PowerPC linker within MPW. (I've never used Apple's SDK, so I really  
  1645. have no idea how that works.) Once you've gotten a fully linked XCOFF file,  
  1646. you can feed it to makepef to produce your PEF container. (And you'll have  
  1647. to do that in MPW 'cause I doubt Apple is distributing the RS/6000 version  
  1648. of makepef anywhere.)
  1649.  
  1650. I'll let John McEnerney detail how you use AIX generated objects with  
  1651. CodeWarrior. So far I've figured out that you need a file of type XCOF and  
  1652. creator UNIX which is a shared reuseable XCOFF library. I believe this  
  1653. implies that CodeWarrior will only link against shared libraries this way,  
  1654. that you can't link the code directly into your app. (Then again I really  
  1655. have no idea how it works.) If that's true, you'll need to make a shared  
  1656. library out of the code you compile on AIX. (The specific process of making  
  1657. a shared library is a a bit involved, but on AIX, you'll need to give ld at  
  1658. least the -bM:SRE switch and an exports file. You feed the output of that to  
  1659. makepef and shove a cfrg resource in the resource fork of the result.)
  1660.  
  1661. Suffice it to say, this is not a trivial task. Though realistically, it is  
  1662. probably the best development environment for Power Macintosh right now.  
  1663. Especially if you have a really huge app, or are working in C++.
  1664. --
  1665. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1666. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1667. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1668.  
  1669. +++++++++++++++++++++++++++
  1670.  
  1671. >From zstern@adobe.com (Zalman Stern)
  1672. Date: Sat, 16 Apr 1994 01:31:01 GMT
  1673. Organization: Adobe Systems Incorporated
  1674.  
  1675. Phil Roth writes
  1676. > In article <2olst3$9oi@crcnis1.unl.edu>, mgleason@cse.unl.edu (Mike  
  1677. Gleason) writes:
  1678. > |> creiman@netcom.com (Charlie Reiman) writes:
  1679. > |> 
  1680. > |> |Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1681. > |> |>I have access to an RS/6000 with the xlc compiler. My question is how
  1682. > |> |>do I use this compiler to generate code for the mac. Could someone  
  1683. with
  1684. > |> |>experience in this area please give me some pointers?
  1685. > |> 
  1686. > |> |You can't, really. The xlc that apple is giving to developers is
  1687. > |> |modified to support the pascal keyword (ignored), #pragma align=68k
  1688. > |> |(very important), and pascal strings (also important). Also, their xlc
  1689. > |> |generates instructions for the PowerPC which probably isn't an option
  1690. > |> |on older versions of xlc.
  1691. > |> 
  1692. > |> Too bad... one could write a preprocessor that could handle the  
  1693. 'pascal'
  1694. > |> and pascal strings, then use that before the cpp for xlc.  Can't get
  1695. > |> around the #pragma align=68k or PowerPC generation, though.
  1696. > The last version of xlc I installed on our research RS/6000 supposedly
  1697. > has PowerPC code generation support ( using -qarch=ppc ).
  1698. > The man page claims that it will
  1699. >     "Produce an object that contains instructions that will
  1700. >     run on any of the 32-bit PowerPC hardware platforms."
  1701. > Also, one can specify an alignment option for aligning structs and unions.
  1702. > The choices are 'power' for the POWER architecture, 'twobyte' for two
  1703. > byte alignment, and 'packed' for one byte alignment.
  1704. > How would this relate to the 'align=68k' pragma discussed above?
  1705.  
  1706. "#pragma options align=mac68k" is a synonym for "#pragma options  
  1707. align=twobyte". Try using the mac68k syntax with the shipping 1.03 version  
  1708. of xlc and I bet it will work. By the way, I left out the "-qarch=ppc"  
  1709. switch in my previous message in this thread. You should give that to xlc to  
  1710. prevent it from generating POWER architecture only instructions.
  1711. --
  1712. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1713. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1714. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1715.  
  1716. +++++++++++++++++++++++++++
  1717.  
  1718. >From d88-jwa@mumrik.nada.kth.se (Jon Wdtte)
  1719. Date: 16 Apr 1994 09:39:13 GMT
  1720. Organization: The Royal Institute of Technology
  1721.  
  1722. In <1994Apr15.101509.21634@adobe.com> zstern@adobe.com (Zalman Stern) writes:
  1723.  
  1724. >You can link on the AIX box as well if you have the right libraries, which  
  1725. >can probably be snagged off Apple's SDK. You'll have to move the XCOFF  
  1726. >result over to a Mac and run makepef in MPW. Optionally, it may be easier to  
  1727.  
  1728. Actually, you CAN execute an XCOFF as well (I haven't tried but heard
  1729. it from an engineer who should know) It's just that they're 3 times the
  1730. size of a PEF...
  1731.  
  1732. -- 
  1733.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1734.  "If people bought cars according to the same principles they buy computers,
  1735.   cars would behave like Lamborghinis but would be built and look like Yugos."
  1736.                      -- Craig Fields
  1737.  
  1738. +++++++++++++++++++++++++++
  1739.  
  1740. >From creiman@netcom.com (Charlie Reiman)
  1741. Date: Mon, 18 Apr 1994 02:53:13 GMT
  1742. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1743.  
  1744. d88-jwa@mumrik.nada.kth.se (Jon Wdtte) writes:
  1745.  
  1746. >In <1994Apr15.101509.21634@adobe.com> zstern@adobe.com (Zalman Stern) writes:
  1747.  
  1748. >>You can link on the AIX box as well if you have the right libraries, which  
  1749. >>can probably be snagged off Apple's SDK. You'll have to move the XCOFF  
  1750. >>result over to a Mac and run makepef in MPW. Optionally, it may be easier to  
  1751.  
  1752. >Actually, you CAN execute an XCOFF as well (I haven't tried but heard
  1753. >it from an engineer who should know) It's just that they're 3 times the
  1754. >size of a PEF...
  1755.  
  1756. 3??? Try 40 times larger. I have a 2 meg pef that I makepef from an xcoff
  1757. that is 70-80megs. 
  1758.  
  1759. Yes, linking takes forever.
  1760.  
  1761. -- 
  1762. "You can't cancel the project! We already made the T-shirts!"
  1763. Charlie Reiman
  1764. creiman@netcom.com
  1765.  
  1766. +++++++++++++++++++++++++++
  1767.  
  1768. >From zstern@adobe.com (Zalman Stern)
  1769. Date: Mon, 18 Apr 1994 04:16:26 GMT
  1770. Organization: Adobe Systems Incorporated
  1771.  
  1772. Charlie Reiman writes
  1773. [XCOFF vs. PEF.]
  1774. > 3??? Try 40 times larger. I have a 2 meg pef that I makepef from an xcoff
  1775. > that is 70-80megs. 
  1776. > Yes, linking takes forever.
  1777.  
  1778. You build with full debug symbols right? XCOFF is a pig, but not that much  
  1779. of a pig. PEF doesn't contain any debug info of course. the .xSYM file for  
  1780. your XCOFF is probably measured in tens of megabytes though.
  1781.  
  1782. Likewise, IBM linker is dramatically faster if you turn off debug info for  
  1783. the compiler. (Unfortunately, there is no switch to the linker to ignore  
  1784. debug info for all but a few object files.) On a pretty hefty RS/6000, I can  
  1785. link in 15 minutes with full symbols and 1 minute with no symbols. I leave  
  1786. in traceback tables (the moral equivalent of Macsbug names) and debug a lot  
  1787. of stuff that way. And at the end of the day, if I'm lucky I manage to club  
  1788. some small mammal on the way back to the cave so I can have dinner :-)
  1789. --
  1790. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1791. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1792. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1793.  
  1794. +++++++++++++++++++++++++++
  1795.  
  1796. >From maynard@elwing.otago.ac.nz (Maynard James Handley)
  1797. Date: Wed, 20 Apr 1994 22:59:21 GMT
  1798. Organization: University of Otago
  1799.  
  1800. Apart from issues like 68K alignment and pascal strings, are there not 
  1801. fundamental problems at the "OS" level?
  1802. For examples, doesn't AIX have conventions about using the first N registers
  1803. to pass variables between functions. I don't know if MacOS on PowerPC has
  1804. such conventions, but it expectects one of the registers always to point
  1805. to the code fragment TOC thingie---would it not be very bad if xlc used
  1806. said register for something else.
  1807.  
  1808. Are these valid issues or not? I don't yet have a copy of IM: RISC system 
  1809. software, so please be gentle if I'm spouting nonsense.
  1810.  
  1811. Maynard Handley
  1812.  
  1813. +++++++++++++++++++++++++++
  1814.  
  1815. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  1816. Date: Thu, 21 Apr 1994 11:22:55 +0800
  1817. Organization: Department of Computer Science, The University of Western Australia
  1818.  
  1819. In article <CoKyIx.I7F@news.otago.ac.nz>, maynard@elwing.otago.ac.nz
  1820. (Maynard James Handley) wrote:
  1821.  
  1822. >Apart from issues like 68K alignment and pascal strings, are there not 
  1823. >fundamental problems at the "OS" level?
  1824. >
  1825. >[lots of talk about calling conventions]
  1826.  
  1827. My understanding is that Apple block-copied IBM's runtime architecture for
  1828. their PowerMacs.  [This is not a criticism, just an observation.  The
  1829. run-time architecture is kinda cool -- apart from the *extreme* silliness
  1830. of allocating two GPRs for each FP parameter just to support
  1831. prototype-less C calling!]
  1832. -- 
  1833. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  1834. Department of Computer Science, The University of Western Australia
  1835.  
  1836. +++++++++++++++++++++++++++
  1837.  
  1838. >From zstern@adobe.com (Zalman Stern)
  1839. Date: Thu, 21 Apr 1994 05:53:08 GMT
  1840. Organization: Adobe Systems Incorporated
  1841.  
  1842. Maynard James Handley writes
  1843. > Apart from issues like 68K alignment and pascal strings, are there not 
  1844. > fundamental problems at the "OS" level?
  1845. > For examples, doesn't AIX have conventions about using the first N  
  1846. registers
  1847. > to pass variables between functions. I don't know if MacOS on PowerPC has
  1848. > such conventions, but it expectects one of the registers always to point
  1849. > to the code fragment TOC thingie---would it not be very bad if xlc used
  1850. > said register for something else.
  1851.  
  1852. The runtime architecture you are refering to was developed by IBM and  
  1853. adopted basically without change by Apple. Binaries running on the RS/6000  
  1854. have used r2 as a TOC pointer for more than four years now. (And that  
  1855. particular convention pretty much came from the IBM RT which shipped in  
  1856. '86.) The PowerPC code in the Power Macintosh ROMs is compiled with xlc.
  1857. --
  1858. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1859. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1860. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1861.  
  1862. +++++++++++++++++++++++++++
  1863.  
  1864. >From R.Beloin@cornell.edu (Ron Beloin)
  1865. Date: Thu, 21 Apr 1994 11:57:00 -0500
  1866. Organization: Boyce Thompson Inst. for Plant Research
  1867.  
  1868. In article <1994Apr18.041626.14768@adobe.com>, zstern@adobe.com (Zalman
  1869. Stern) wrote:
  1870. > [XCOFF vs. PEF.]
  1871. > [other stuff about XCOFF]
  1872.  
  1873. Sorry for the basic question, but how does one link XCOFF format
  1874. files from an RS6K in MPW? E.G., what version of Link do i need, what
  1875. options or swithches are required. I already have the RS6K and E.T.O.
  1876. Thanks.
  1877. -- 
  1878. Ron Beloin (R.Beloin@cornell.edu)
  1879. [who works, but doesn't speak, for the]
  1880. Boyce Thompson Inst.
  1881. Ithaca, NY
  1882.  
  1883. +++++++++++++++++++++++++++
  1884.  
  1885. >From zstern@adobe.com (Zalman Stern)
  1886. Date: Thu, 21 Apr 1994 23:31:46 GMT
  1887. Organization: Adobe Systems Incorporated
  1888.  
  1889. Ron Beloin writes
  1890. > In article <1994Apr18.041626.14768@adobe.com>, zstern@adobe.com (Zalman
  1891. > Stern) wrote:
  1892. > > [XCOFF vs. PEF.]
  1893. > > [other stuff about XCOFF]
  1894. > Sorry for the basic question, but how does one link XCOFF format
  1895. > files from an RS6K in MPW? E.G., what version of Link do i need, what
  1896. > options or swithches are required. I already have the RS6K and E.T.O.
  1897. > Thanks.
  1898.  
  1899. You need ppclink off the Macintosh on RISC SDK.
  1900. --
  1901. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1902. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1903. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1904.  
  1905. +++++++++++++++++++++++++++
  1906.  
  1907. >From d88-jwa@mumrik.nada.kth.se (Jon Wdtte)
  1908. Date: 23 Apr 1994 10:40:51 GMT
  1909. Organization: The Royal Institute of Technology
  1910.  
  1911. In <R.Beloin-210494115700@theq.cit.cornell.edu> R.Beloin@cornell.edu (Ron Beloin) writes:
  1912.  
  1913. >Sorry for the basic question, but how does one link XCOFF format
  1914. >files from an RS6K in MPW? E.G., what version of Link do i need, what
  1915. >options or swithches are required. I already have the RS6K and E.T.O.
  1916.  
  1917. You need the Mac on RISC SDK CD which comes with PPCLink and
  1918. MakePEF. It also comes with the right headers and libraries.
  1919.  
  1920. Cheers,
  1921. -- 
  1922.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1923.  
  1924.   "Never mistake a clear view for a short distance"
  1925.                      -- Saffo
  1926.  
  1927. +++++++++++++++++++++++++++
  1928.  
  1929. >From Dave Falkenburg <falken@apple.com>
  1930. Date: Thu, 28 Apr 1994 17:03:33 GMT
  1931. Organization: Apple Computer, Inc.
  1932.  
  1933. In article <CoKyIx.I7F@news.otago.ac.nz> Maynard James Handley,
  1934. maynard@elwing.otago.ac.nz writes:
  1935. >For examples, doesn't AIX have conventions about using the first N
  1936. registers
  1937. >to pass variables between functions. I don't know if MacOS on PowerPC has
  1938. >such conventions, but it expectects one of the registers always to point
  1939. >to the code fragment TOC thingie---would it not be very bad if xlc used
  1940. >said register for something else.
  1941.  
  1942. The PowerMac runtime environment is dervied from the AIX runtime model--
  1943. we used special versions of xlc to build the native portions of the
  1944. toolbox.
  1945.  
  1946. -Dave Falkenburg
  1947. -Apple Computer, Inc.
  1948.  
  1949. ---------------------------
  1950.  
  1951. End of C.S.M.P. Digest
  1952. **********************
  1953.  
  1954.  
  1955.