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,3f60acc31578c72b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!newsfeed.yul.equant.net!opentransit.net!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Message-ID: <4416F491.6080309@obry.net> Date: Tue, 14 Mar 2006 17:51:29 +0100 From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 Newsgroups: comp.lang.ada To: Norbert Caspari Subject: Re: question about tasks, multithreading and multi-cpu machines References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 14 Mar 2006 17:51:30 CET NNTP-Posting-Host: 82.120.145.91 X-Trace: 1142355090 news.wanadoo.fr 19698 82.120.145.91:2887 X-Complaints-To: abuse@wanadoo.fr Xref: g2news1.google.com comp.lang.ada:3356 Date: 2006-03-14T17:51:30+01:00 List-Id: Norbert Caspari a �crit : > In Ada it is possible to declare multiple parallel running "tasks". But for > my opinion the keyword "task" is somewhat misleding because in fact, those > "tasks" are really threads. Tasks are higher level than threads. For example it comes with Rendez-vous. Tasks can indeed be implemented using threads on some OS. It is the case for GNAT on GNU/Linux and Windows for example. > If I run such a program on a multi-cpu machine, the process itself will use > only one cpu, even though I create several "tasks". Strange, threads should be properly scheduled by the OS to use multiple CPU. Looks like an OS issue to me... Or a runtime issue, I don't remember how tasking was implemented on HPUX on GNAT 3.15p. > I tested this with gnat v3.15p under HPUX 11 on a multi-cpu server. > > How can I write my code to utilize all cpu's on such a machine? Is there a > different way in Ada to perform multi-tasking instead of multi-threading? Use Tasks. > Thank you for your help! You're welcome. Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595