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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e0e1d3b3f7c994b8 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Robert Dewar's great article about the Strengths of Ada over other langauges in multiprocessing! Date: Mon, 10 Mar 2008 16:24:32 -0500 Organization: Jacob's private Usenet server Message-ID: References: <13t4b2kkjem20f3@corp.supernews.com> <89af8399-94fb-42b3-909d-edf3c98d32e5@n75g2000hsh.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1205184359 32519 69.95.181.76 (10 Mar 2008 21:25:59 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 10 Mar 2008 21:25:59 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:20280 Date: 2008-03-10T16:24:32-05:00 List-Id: "Maciej Sobczak" wrote in message news:89af8399-94fb-42b3-909d-edf3c98d32e5@n75g2000hsh.googlegroups.com... ... > Take for example lock-free algorithms. There is no visible research on > this related to Ada, unlike Java and C++ (check on > comp.programming.threads). Perhaps I'm showing my ignorance, but does there need to be any? Ada supports lock-free threads quite well using pragma Atomic. I find that the only locks in my recent programs are (1) those for selecting a new job; (2) those for protecting the logging resources; and (3) those for protecting complex data structures (such as pattern sets) that can be updated asynchronously. The vast majority of the code does not contain any locks. There's no hope of avoiding the locks that protect shared OS resources - ultimately devices - you could push them into the OS, but that's about it. The data structure locks might be avoidable in some cases - but that doesn't seem language-specific (surely if you can write a lock-free queue algorithm in C you can write it in Ada - and probably with less games). If Ada needs anything, it is more emphasis on tasking safety - that is, detection of unsafe access to shared objects, livelocks, and deadlocks - that would make it easier to write correct tasking programs. That's clearly possible in Ada because the threading is an integral part of the semantics of the language, and it would add value to the existing facilities of the language. Randy.