Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: Forth dictionary implementation and performance Date: Mon, 01 Feb 2016 00:47:15 -0800 Organization: A noiseless patient Spider Lines: 16 Message-ID: <87twlsq0ks.fsf@jester.gateway.pace.com> References: <2016Jan29.184253@mips.complang.tuwien.ac.at> <87k2mrrk95.fsf@jester.gateway.pace.com> <2016Jan30.145442@mips.complang.tuwien.ac.at> <8737tdr075.fsf@jester.gateway.pace.com> <2016Feb1.074719@mips.complang.tuwien.ac.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="89fc4f87faf042e7e4d428a3639a51e3"; logging-data="18484"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ahiiUIhBpVG8QeXhdxPrC" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:V7XFaW8cZWtXr1fR8pnxp1R1434= sha1:FuXGwFvmLaRlWMMpaIsOwP5EdS0= Xref: csiph.com comp.lang.forth:45229 anton@mips.complang.tuwien.ac.at (Anton Ertl) writes: > : > |If PROT_WRITE is specified, the application shall ensure that it has > |opened the file descriptor fildes with write permission unless > |MAP_PRIVATE is specified in the flags parameter as described below. Ah, ok, that clears things up nicely, thanks. > My expectation is that read first causes the disk contents to be > loaded into kernel buffers, and then copies the data to user space, > while mmap() maps the OS buffers into user space without copying > (except the copy-on-write when I write to it). That's possible, though read() might be optimized in the case that the user buffer is page aligned. The copying might still be slower than the extra context switches and potentially extra disk operations.