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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.222.197 with SMTP id qo5mr10348848pac.44.1465149801832; Sun, 05 Jun 2016 11:03:21 -0700 (PDT) X-Received: by 10.157.25.166 with SMTP id k35mr49753otk.6.1465149801559; Sun, 05 Jun 2016 11:03:21 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!q32no4021835qgq.0!news-out.google.com!107ni231qgx.1!nntp.google.com!q32no4021820qgq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 5 Jun 2016 11:03:21 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=78.192.88.225; posting-account=21X1fwoAAABfSGdxRzzAXr3Ux_KE3tHr NNTP-Posting-Host: 78.192.88.225 References: <22fc2a58-67ad-4483-bf9c-0bdc463b31ab@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5a13cc49-d201-42c3-965f-34ebbbdce977@googlegroups.com> Subject: Re: User threads in Ada ? From: Hadrien Grasland Injection-Date: Sun, 05 Jun 2016 18:03:21 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3248 X-Received-Body-CRC: 4054144250 Xref: news.eternal-september.org comp.lang.ada:30622 Date: 2016-06-05T11:03:21-07:00 List-Id: Le dimanche 29 mai 2016 00:11:20 UTC+2, joak...@kth.se a =C3=A9crit=C2=A0: > Den l=C3=B6rdag 28 maj 2016 kl. 23:08:03 UTC+2 skrev Hadrien Grasland: > > Hi everyone, > >=20 > > Recently, cooperatively scheduled user threads have become popular agai= n in the parallel programming community. The main goal behind their use is = typically to avoid spawning, blocking and liberating kernel threads all the= time, which comes with some significant overhead. > >=20 > > Some C++ libraries such as Intel TBB and HPX now make it much easier an= d portable than before to deal with such user threads, in no small part tha= nks to a couple of nice abstractions, such as asynchronous function calls r= eturning futures that provide event-like synchronization. > >=20 > > I'm currently playing around with this concept in Ada, and wondering ho= w far it can be taken. The first thing to do being, of course, to tell what= is already there. Is anyone aware of previous work related to implementing= user threads in Ada ? > >=20 > > Cheers, > > Hadrien >=20 > Dear Hadrien, >=20 > What comes to my mind is the Generic_Tasking package I wrote to create a = pool of worker tasks and to distribute the work-load on them: > https://github.com/joakim-strandberg/determine_prime_numbers_on_many_core= _systems >=20 > I have not looked at TBB nor HPX but can imagine their API is nicer and m= ore thought through. >=20 > Brad Moore has shared code also. Google for "Paraffin". >=20 > Best regards, > Joakim Thanks for these answers! After taking a look, I don't think either of thos= e quite matches what I have in mind as far as the core tasking model is con= cerned, so in the end I started rolling my own project, which I will announ= ce here once it reaches a good enough shape. However, the higher-level data-parallel API of paraffin is pretty nice and = I will most likely take inspiration from it when I get to the point of tryi= ng to implement data-parallel primitives on top of my task-parallel API.