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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: aws vs ruby rails or php? how much faster? Date: Thu, 2 May 2013 16:13:24 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <87vc7fm3lp.fsf@adaheads.sparre-andersen.dk> <517627a4$0$32104$14726298@news.sunsite.dk> <1bjhu6xj0sh4e.1u1r23nzr3zrh$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1367529211 20339 69.95.181.76 (2 May 2013 21:13:31 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 2 May 2013 21:13:31 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:15298 Date: 2013-05-02T16:13:24-05:00 List-Id: "Yannick Duchêne (Hibou57)" wrote in message news:op.wvzrlknsule2fv@cardamome... Le Tue, 23 Apr 2013 12:08:15 +0200, Dmitry A. Kazakov a écrit: >> On Tue, 23 Apr 2013 09:10:39 +0200, Yannick Duchêne (Hibou57) wrote: >> >>> Asynchronous I/O can be achieved with Ada too, and that does not implies >>> tasking, just wrapping what the OS provides for that. >> >> Oh, it does. I don't know what you guys are talking about, but >> asynchronous >> I/O is intimately related to tasking. > >Yes it is, but as you said, it save tasks. The application doing >asynchronous I/O, does not even need to run multiple tasks, just only one >which is its own task, as the second may be required task can be provided >by the OS (and may be just interrupts, depending on the kind of I/O). When >I said "does not implies tasking", I wanted to underline the same as you >did, that it does not cost tasks. True enough, but the *implementation* of asynchronous I/O matters just as much. A bit of background: Janus/Ada uses it's own task management, so all tasks run inside of a single OS process/thread. In our web server running on Windows 2K, we tried to use asynchonrous socket I/O to prevent unintended blocking from socket calls. But the effect was that the server ran 10 times slower than using busy-waited socket I/O; effectively W2K used only a single OS thread to implement then asynchronous sockets and that effectively serialized everything going in and out of the server. So we had to remove that and return to the busy-waited sockets. [Two notes: the program uses Ada tasks; we just have to use the busy-waited sockets to avoid blocking the entire server if nothing is ready; the busy-wait loop contains a delay to allow other tasks to run if there is nothing to do. Tuning these loops to the way sockets I/O works (either the data is available immediately, or it is going to take a bunch of milleseconds before it will show up) keeps the overhead to a minimum. Second, I don't know if this is true on newer versions of Windows, I've never had reason to test it. The web server still runs on the 900 MHZ W2K server (soon to be retired in favor of a new Debian machine - with 3GHZ with 8 virtual cores - a rather different environment). Randy.