From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 29 Jul 2008 19:04:44 +0400 To: "weigelt@metux.de" , "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> From: Alexander Sychev Content-Type: text/plain; format=flowed; delsp=yes; charset="utf-8" MIME-Version: 1.0 References: <20080717142135.539A31E8C1C@holo.morphisms.net> <20080729085214.GA3072@nibiru.local> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <20080729085214.GA3072@nibiru.local> User-Agent: Opera Mail/9.51 (Linux) Subject: Re: [9fans] mmap Topicbox-Message-UUID: f3c22e62-ead3-11e9-9d60-3106f5b1d025 On Tue, 29 Jul 2008 12:52:14 +0400, Enrico Weigelt wrote: Hi! > an full mmap() is a really nice thing. It can make a lot things > easier if you just map the whole file into the process' memory and > let the kernel handle the actual IO. Yes, it is comfortable. But just think a bit - what will you do in the mmap implementation when you had mapped a remote file (in Plan9 you can't be sure some file is local or it is really just a file), and the connection has just been broken? Surprise! For example, in Windows you will have an "access violation". It is very funny to rewrite a code for using the good old file i/o instead of mmap. In Linux you can't map a non-regular file. Yes, you can read entire the file into the memory, but a size of the file can be very big and you will destroy the main advantage of mmap - the reading of only needed pieces of the file, not entire. I beleive, mmap is not for distributed systems. -- Best regards, santucco