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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 19 Dec 2014 18:39:24 -0600 Newsgroups: comp.lang.ada Date: Fri, 19 Dec 2014 19:39:22 -0500 From: Peter Chapin X-X-Sender: pcc09070@WIL414CHAPIN.vtc.vsc.edu Subject: Re: GNAT and Tasklets In-Reply-To: <2d4fc21f-5739-4100-9551-959b6822c761@googlegroups.com> Message-ID: References: <455d0987-734a-4505-bb39-37bfd1a2cc6b@googlegroups.com> <8277a521-7317-4839-b0b6-97f8155be1a4@googlegroups.com> <9e1d2b9f-1b97-4679-8eec-5ba75f3c357c@googlegroups.com> <2d4fc21f-5739-4100-9551-959b6822c761@googlegroups.com> User-Agent: Alpine 2.11 (CYG 23 2013-08-11) Organization: Vermont Technical College MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-xeoVWdDNAX0MBiKNmjKzMerxBc7FpenirascUVNebL4DKZya34sy55gkt8SrAWjhw+9XdbV4RzSyKTg!sYH0smwwKIhh2nRK/NVTCBMdpaBqWDorh5/8r+vm/kz+N94KguHKYL2ntQ4NALLXlLGAfD3gRI+u!PCfTBg5OKis0ityFgA== X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3004 Xref: news.eternal-september.org comp.lang.ada:24169 Date: 2014-12-19T19:39:22-05:00 List-Id: On Fri, 19 Dec 2014, vincent.diemunsch@gmail.com wrote: > Ada have created the task abstraction to deal with parallelism... I haven't tried any parallel programming with Ada but I have used both OpenMP and "direct" pthreads calls in parallel C programs. Creating and managing threads manually is a major pain compared to what OpenMP does. Sure it's possible to use threads directly but it clutters the program's logic and it's tricky to get it both right and efficient at the same time. Ada's tasking features are a lot nicer than pthreads, but I agree with the point others have made that they are the wrong tool for writing parallel code... at least writing parallel code without extreme pain. Tasks are good for large, relatively independent chunks of logic that need to execute concurrently such as different control loops in an embedded system. However, when writing parallel code that will execute over highly regular data structures such as large matrices, explicit tasks are just a distraction. In such applications the existence of tasks is an implementation detail, not a design element. Trying to use explicit tasks for parallel programming is a kind of abstraction inversion: using a high level construct to implement some low level functionality. Sure it is possible but the result is ugly and inefficient. Peter