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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: What exactly is the licensing situation with GNAT? Date: Tue, 18 Nov 2014 10:20:47 +0100 Organization: cbb software GmbH Message-ID: <13efsbp4ynti1.1qsb6buqa4a60.dlg@40tude.net> References: <084b1934-9641-425e-85ec-293e0334413e@googlegroups.com> <86bf69c8-eb08-4696-b6c9-3784f5c42213@googlegroups.com> <87389olqie.fsf@ixod.org> <19fa65d4-72c9-44ab-b44b-4ea0929c18f2@googlegroups.com> <25731193-c0b5-4ab7-87ff-ba8c6a42cdbd@googlegroups.com> <1se4bvo6gaqft.16cfjaiketlz0$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: nyHeW7QjJmC1odUjK4LkDA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:23512 Date: 2014-11-18T10:20:47+01:00 List-Id: On Mon, 17 Nov 2014 18:28:42 -0600, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:1se4bvo6gaqft.16cfjaiketlz0$.dlg@40tude.net... >> On Fri, 14 Nov 2014 16:29:59 -0600, Randy Brukardt wrote: >> >>> I've been using Claw.Sockets for so long that I don't know what the >>> underlying implementation is. So I don't know what "select" is used for >>> or >>> whether it's implemented in NC_Sockets. Claw.Sockets has a server type >>> that's used for implemented servers (like web and mail servers). >> >> Select() is essential for heavy duty and light weight servers as it allows >> one task to handle multiple sockets without blocking. AdaSockets, the only >> alternative to GNAT.Sockets I know, does not support select. >> >> (I don't know if AWS uses blocking sockets for its server or >> socket-select) > > Incoming or outgoing? Both and connect, disconnect as well. > Since Janus/Ada only uses one thread per Ada program, > no server would work at all if everything was blocking. I know the server > type works well distributing accesses to different Ada tasks (even on > Janus/Ada, where everything is done by one thread). > > OTOH, we implemented non-blocking sockets for outbound traffic in Claw > sockets as well. I implemented a version of the web server using those > sockets, and it turned out the performance (at least on Windows 2K/XP) was > something like 10 times slower using non-blocking sockets compared to > busy-waiting the blocking sockets. Depends on how you measured it. Latencies may increase for obvious reason of context switching. The rest should have no influence. > Apparently, Windows launches threads for > the non-blocking socket operations, which is SLOW. No, that cannot be. We are using non-blocking sockets massively e.g. tens of thousands, needed to fiddle system settings to allow so many. It certainly does not start threads because Windows cannot have so many. > I made the busy-waiting > much smarter in the web server (using a increasing wait for each iteration) > and got much better overall performance than either alternative. Did you use this: http://msdn.microsoft.com/en-us/library/windows/desktop/ms741576%28v=vs.85%29.aspx This a simpler alternative with more control over the policies as compared to the traditional select: http://msdn.microsoft.com/en-us/library/windows/desktop/ms740141%28v=vs.85%29.aspx -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de