From ... Path: supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.stanford.edu!news.tele.dk!148.122.208.68!news2.oke.nextra.no!nextra.com!news01.chello.no!Norway.EU.net!127.0.0.1!nobody From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: corba or sockets? Date: 30 Oct 2000 20:13:52 +0000 Organization: Naggum Software; vox: +47 800 35477; gsm: +47 93 256 360; fax: +47 93 270 868; http://naggum.no; http://naggum.net Lines: 43 Message-ID: <3181925632541238@naggum.net> References: <3181900924130896@naggum.net> <3181908033332322@naggum.net> <4darvsgcli47dtrp0auo2pn14kar0fa9vv@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: oslo-nntp.eunet.no 972939901 22024 195.0.192.66 (30 Oct 2000 21:05:01 GMT) X-Complaints-To: newsmaster@eunet.no NNTP-Posting-Date: 30 Oct 2000 21:05:01 GMT mail-copies-to: never User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 Xref: supernews.google.com comp.lang.lisp:2932 * Fernando Rodríguez | Could you elaborate on this, with some example, please? Why? Consider the "normal" way people implement streams, with a single buffer that is over-written with new data as the reading crashes into the right buffer wall and then continues from the left end of the buffer. This is not smart in a modern world. Instead of crashing into a buffer wall, have several buffers. Ask the operating system to fill them for you while you're more or less busy processing the data already read, as in "asynchronously". The operating system is doing a decent job of predicting your linear progression through the file, anyway, so it sort of works to crash into buffer walls and get first aid from the operating system and get back on your feet, but it is far from optimal, and no matter what you do with that system call, it at _least_ has to copy the buffer contents from system memory to user memory, which is also probably at a really bad alignnment for hardware support for such copying. Several page-aligned buffers can cause I/O to occur at the operating system's discretion, copying is not needed if the operating system can map the page directly into user space, and you can scan through a large file in no time compared to these false stops and starts as you crash into buffer walls. Consider the sending of mail to someone with SMTP. As long as you have well-defined state transitions that are (fairly) independent, send a whole bunch of commands down the wire and match the responses to the requests sent instead of waiting for each response by itself. Consequence? _Dramatic_ speedup when sending to many recipients. In normal human life, you don't get paralyzed and die if you don't an answer to a question, but (carefully) go on with assumptions because you probably have a pretty good idea what kind of answer you're going to get. Just how many code paths could you possibly walk down depending on the answer? Do them all! You certainly have the time while the bits trickle across the globe. #:Erik -- Does anyone remember where I parked Air Force One? -- George W. Bush