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!postnews2.google.com!not-for-mail From: wojtek@power.com.pl (Wojtek Narczynski) Newsgroups: comp.lang.ada Subject: Re: Feasibility of using Ada in new development Date: 6 Sep 2004 08:32:32 -0700 Organization: http://groups.google.com Message-ID: <5ad0dd8a.0409060732.4e92e7a6@posting.google.com> 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: 62.111.211.178 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1094484753 25343 127.0.0.1 (6 Sep 2004 15:32:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 6 Sep 2004 15:32:33 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:3384 Date: 2004-09-06T08:32:32-07:00 List-Id: Hello, With ST implementations already exist. Non-preemptive scheduling (from GHS) alone is not enough. What I would need is scheduling based on file descriptor readiness. > Fundamentally, what you need is fast task switching and and if you > want to minimize the number of locks, non-preemptive scheduling. This is why I asked about a cooperative GNAT runtime some time ago on this list :-) > 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. I compiled GNAT 3.4.1 FSU pthreads runtime. When I use libgthread.a supplied with binary gnat-3.15p it only grumbles about errno at link time. When I export errno in my app, it works. I also compiled the curent fsu pthreads http://www.informatik.hu-berlin.de/~mueller/pthreads/ (only compiles with gcc 2.x series), but those two turned out to be rather out of sync, and it is not documented, which version of pthreads, and which switches, to use. But in general this is my current idea to obtain a runing cooperative fsu-pthreads gnat 3.4.1 runtime, and then try to modify the scheduler to consider IO. The problem is signals, my current idea is to have minimal signal handlers that will merely make note of the signal reception, and then have the scheduler dispatch the actual Signal_Handler. I also expect to run into scalability problems of the runtime itself, mean things like All_Task_List, with emphasis on 'list'. Another idea of mine is to port the runtime to GNU Pth, which does the same as ST, and more. Porting the GNAT runtime to ST seems infeasible. > I would think using any library derived from Netscape *IS* high risk. > It is easily the most bug-ridden program on my desktop. You might be confusing Netscape server business (yes, there used to be one), with their browser busines :-) Using State Threads incurrs little risk alone, because it is only 3000 lines of (IMO quite good) code, but using C is high risk. This is why, for quite some time, I've been thinking how to do it in Ada. > 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. There sure will be locks, but they never require syscalls, nor even CMPXCHG. In other words, they are extremely fast locks. But it's not really about locks, it's about socket descriptor readiness. Thanks for confirming what I already know on this subject :-) Regards, Wojtek