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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!wn13feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada,comp.realtime,comp.software-eng Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) From: Jim Rogers References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <112rs0bdr2aftdf@corp.supernews.com> <1inxxr988rxgg$.1w9dedak41k89.dlg@40tude.net> <112s1r0rf0o8nca@corp.supernews.com> <112sonip5v4dca6@corp.supernews.com> User-Agent: Xnews/5.04.25 Message-ID: Date: Wed, 09 Mar 2005 04:34:44 GMT NNTP-Posting-Host: 12.73.183.168 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1110342884 12.73.183.168 (Wed, 09 Mar 2005 04:34:44 GMT) NNTP-Posting-Date: Wed, 09 Mar 2005 04:34:44 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:8907 comp.realtime:1099 comp.software-eng:4656 Date: 2005-03-09T04:34:44+00:00 List-Id: CTips wrote in news:112sonip5v4dca6@corp.supernews.com: > Martin Dowie wrote: >> CTips wrote: >> >>> Will that generate: >>> L0: >>> lwlock temp,&Value >>> add temp,temp,1 >>> stwcond temp,&Value >>> if( failed ) goto L0; >>> or will it generate something much more heavy-weight. >> >> >> If you need that particular assembler then you'd best write it >> yourself. I don't know of any language that could guarentee what >> assembler is produced following a compilation. >> >> Cheers >> >> -- Martin > > But isn't it interesting that Ada can't express this? > > Roughly speaking, Ada provides synchronous message passing and > (non-nested?) monitors as first class constructs. This means that > - it doesn't support asynchronous communication > - it doesn't support any number of lock-free algorithms > Also, Ada's only scheduling/queing discipline is FIFO with priorities > (and priorities are only available if the RT annex is actually > implemented). If I want to do earliest-deadline first, well, how do I > go about doing it? I think you are missing some Ada capabilities. While Ada does provide synchronous message passing and monitors, it also provides the ability to declare objects as atomic and volatile. Atomic objects can be used instead of monitors (what Ada calls protected objects) for inter-task communication. You can then define your own schemes including lock-free algorithms or dcl. If you want different scheduling policies you write them, just as in C or C++. How, using C or C++, would you create a threaded program and ensure that signals are handled by a specified thread, and not simply by the thread that is currently running when the signal is received? How will you handle general OS signals in this manner and not only the specialized signals provided by pThreads? You seem to assume that Ada only allows you to use features provided by the language while preventing you from creating your own features. That idea just doesn't make any sense. Linked lists are not implemented as native syntax in either Ada or C, yet they are used frequently in both languages. How can that be? Jim Rogers