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,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-ArrivalTime: 2001-08-05 10:21:48 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!148.122.208.68!news2.oke.nextra.no!nextra.com!news3.oke.nextra.no.POSTED!not-for-mail From: "Tor Rustad" Newsgroups: comp.lang.ada,comp.lang.c References: <9k9if8$rn3$1@elf.eng.bsdi.com> <3B687EDF.9359F3FC@mediaone.net> <5267be60.0108021911.7d8fe4@posting.google.com> <3B6B637F.E3FA243E@worldnet.att.net> <3B6C0DC7.661B3D46@worldnet.att.net> Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Message-ID: NNTP-Posting-Host: 130.67.69.38 X-Complaints-To: news-abuse@nextra.no NNTP-Posting-Date: Sun, 05 Aug 2001 19:21:36 MEST Organization: Nextra Public Access X-Trace: news3.oke.nextra.no 997032096 130.67.69.38 Date: Sun, 5 Aug 2001 14:44:37 +0200 Xref: archiver1.google.com comp.lang.ada:11318 comp.lang.c:72306 Date: 2001-08-05T14:44:37+02:00 List-Id: [snipped comp.lang.c++,comp.lang.functional] "James Rogers" wrote in message > Tor Rustad wrote: > Given your analysis of performance related to languages I could > state that C programs are clearly slower than Ada programs with > run time checking turned on. How can this be so? Easy. > > Ada provides efficient built in support for concurrency. C does not. Right, however strictly conforming C programs are rare beasts in real life. For example sockets are no more part of ISO C than e.g. POSIX pthreads are! > Therefore, the most common and natural design for a C program is > single threaded. On the other hand, it is very common to have a > multi-threaded Ada program. Given a common platform, such as a PC > running a Win 32 operating system, I could easily build an Ada > program with multiple threads implementing a socket server, that > would blow away any single threaded C implementation. Just for the record, sockets has support for non-blocking I/O, and a single threaded server may very well run faster than a multi-threaded server. Also, I think the most common server design by C programmers (on Win32) is to use multi-threading, and using a lot of *context* switching. :-) -- Tor "Dijkstra probably hates me" - Linus Torvalds