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,e7151167e0767ecc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.uni-stuttgart.de!carbon.eu.sun.com!new-usenet.uk.sun.com!not-for-mail From: Ole-Hjalmar Kristensen Newsgroups: comp.lang.ada Subject: Re: Feasibility of using Ada in new development Date: 06 Sep 2004 09:36:45 +0200 Organization: Sun Microsystems Message-ID: References: <8429999a.0408231027.2850e800@posting.google.com> <5ad0dd8a.0408302222.56282d6f@posting.google.com> <4135498c_1@news.tm.net.my> <5ad0dd8a.0409040738.3fff41b8@posting.google.com> NNTP-Posting-Host: khepri06.norway.sun.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: new-usenet.uk.sun.com 1094456206 302 129.159.112.195 (6 Sep 2004 07:36:46 GMT) X-Complaints-To: usenet@new-usenet.uk.sun.com NNTP-Posting-Date: 6 Sep 2004 07:36:46 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:3355 Date: 2004-09-06T07:36:46+00:00 List-Id: >>>>> "WN" == Wojtek Narczynski writes: WN> Final example, I am sincerely interested in the resolution, you may WN> perceive it as a challenge for an Ada zealot: WN> - http://state-threads.sourceforge.net/ how would you do this in Ada WN> (thread = task)? http://citeseer.ist.psu.edu/681845.html describes why WN> I would want this. Its was shown years ago by researchers from IBM, that switching threads only when the application was in a well-defined state gave opportuninty for considerable optimization of thread switching, so the basic idea is sound. But I am not convinced that the advantages of using state-threads are much more than you would get from just using another task dispatching policy in Ada. Thre trouble with that is of course that such a policy is not part of the Ada standard. On the other hand, state-threads aren't a standard either. I think just switching from a the native threads interface in GNAT to the user-space POSIX version should give you an order of magnitude better performance wrt. task switching time, at least it did last time I tried it. You also will get some of the drawbacks, like your whole program will block on some OS calls. Fundamentally, what you need is fast task switching and and if you want to minimize the number of locks, non-preemptive scheduling. I believe that at least one Ada vendor (Green Hills) can supply you with a version which supports non-preemptive scheduling. I also think that it is possible to compile the FSU Pthreads library in such a way that it will give you non-preemptive scheduling. Whether the GNAT runtime would still work with a modified FSU pthreads, I cannot say. WN> I really don't know wether to start a six months and up, high risk, WN> project to modify the GNAT runtime, or just use this library in C. I would think using any library derived from Netscape *IS* high risk. It is easily the most bug-ridden program on my desktop. Also, do not believe that when using non-preemptive scheduling that you can get rid of *ALL* locks. Depending on you application, there will usually be locks which must be held between activations of your thread. WN> Regards, WN> Wojtek -- C++: The power, elegance and simplicity of a hand grenade.