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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aef3b280a3831a63,start X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!news.glorb.com!news2.telebyte.nl!fr.ip.ndsoftware.net!proxad.net!wanadoo.fr!not-for-mail From: Pascal Obry Newsgroups: comp.lang.ada Subject: C omega Date: 05 Jun 2004 16:25:52 +0200 Organization: Home - http://www.obry.org Message-ID: NNTP-Posting-Host: avelizy-103-1-2-89.w217-128.abo.wanadoo.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news-reader5.wanadoo.fr 1086445552 28458 217.128.15.89 (5 Jun 2004 14:25:52 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 5 Jun 2004 14:25:52 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.95 Xref: g2news1.google.com comp.lang.ada:1125 Date: 2004-06-05T14:25:52+00:00 List-Id: Something quite interesting. Microsoft is going to add some concurrency support in C-omega. There is a paper on the link I gave in a previous message. They present the classic Reader-Writer paradigm using the C-omega chord (only 5 chords they say) implementation, here it is: class ReaderWriter { ReaderWriter() { idle (); } public void Shared() & async idle() {s (1); } public void Shared() & async s(int n) { s(n+1); } public void ReleaseShared() & async s(int n) { if (n == 1) idle (); else s(n-1); } public void Exclusive() & async idle() {} public void ReleaseExclusive() {idle (); } } I'm not sure to fully understand the code above, but it looks quite complex to me :) What is interesting is that the same code(*) in Ada (not compiled) is: protected Reader_Writer is function Read return Integer; procedure Write (X : in Integer); private State : Integer; end Reader_Writer; protected body Reader_Writer is function Read return Integer is begin return State; end Read; procedure Write (X : in Integer) is begin State := X; end Write; end Reader_Writer; But of course they have given some modula-3 code to compare to the C-omega one! Isn't it fair ?!? Pascal. (*) I suppose it is the same code by reading the description they gave about the ReaderWriter C-omega implementation. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.org --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595