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,e0e1d3b3f7c994b8 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Robert Dewar's great article about the Strengths of Ada over other langauges in multiprocessing! Date: Tue, 11 Mar 2008 11:12:24 +0100 Message-ID: <63n48fF27akbnU1@mid.individual.net> References: <13t4b2kkjem20f3@corp.supernews.com> <89af8399-94fb-42b3-909d-edf3c98d32e5@n75g2000hsh.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: individual.net xuonLcBsJPpHzQOwZrpnhwXXurVC+jq1JHCEiJQIao+4IDVTk= Cancel-Lock: sha1:Ns1SFZoobGZwKYt0t3DV90iuslQ= User-Agent: KNode/0.10.5 Xref: g2news1.google.com comp.lang.ada:20293 Date: 2008-03-11T11:12:24+01:00 List-Id: Randy Brukardt wrote: > "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. This is also my experience. Thanks to the simple and easy to understand Ada tasking, I was writing multithreaded programs routinely many years ago, when no consumer multi-core existed. I did this simply because some processes are very naturally separable in tasks, simplifying both implementation and understanding, since I couldn't benefit from multiprocessors. This means that these programs would benefit (not in use anymore) from multi-core today with zero effort on my part, and without dependencies on external libraries. I still get shivers when I see C/C++ code with manually P/V locked semaphores. C has no controlling and no alternative, and some people doing C++ is still mimicking C without taking advantage of full C++. Is there excuses for not using automatic critical sections in C++?