From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,567f87f476bd8e1c X-Google-Attributes: gid103376,public From: Greg Bond Subject: Re: Tips for realtime embedded Ada? Date: 1996/04/23 Message-ID: <317D39D6.4F3@ee.ubc.ca>#1/1 X-Deja-AN: 151033285 references: <4ku9jf$b7u@hacgate2.hac.com> <4l54f0$sg0@fred.netinfo.com.au> <4lgtnk$jm9@rational.rational.com> content-type: text/plain; charset=us-ascii organization: Dept. of Electrical Eng., UBC mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.01 (Macintosh; I; PPC) Date: 1996-04-23T00:00:00+00:00 List-Id: Bob Kitzberger wrote: > > Alan Brain (aebrain@dynamite.com.au) wrote: > > : 1) Don't use Tasking except as a Guardian of resources. Very few > : compilers do context-switching efficiently. Write a scheduler in > : assembler, or if you can, microcode. > > I would suggest that you first check the PIWG tasking benchmark > results, and study the vendor's documentation on tasking, before > throwing out the baby with the bathwater. "Passive tasking > optimizations", performed by some vendors, can reduce context > switching time by an order of magnitude, to the level of > user-written semaphore-protected regions. Being able to specify > concurrent behavior at the language level is very useful, so > make sure you know what you're giving up, and why, before you > run off and write your own scheduler. In fact, Ada 95's protected objects (like Posix..4a monitors/condition variables only better) can be implemented so that they they involve fewer lock/unlock operations, and fewer context switches than an equivalent semaphore-based implementation. In addition, if priority ceiling locking is used (also Posix.4a/Ada 95), lock/unlock operations do not have to use queueing which further improves performance. --- * Greg Bond * Dept. of Electrical Eng. * email: bond@ee.ubc.ca * Univ. of British Columbia * voice: (604) 822 0899 * 2356 Main Mall * fax: (604) 822 5949 * Vancouver, BC * web: http://www.ee.ubc.ca/~bond * Canada, V6T 1Z4