Sujet : Re: streams and file locks, ancient OS history, ARM is sort of channeling the IBM 360
De : johnl (at) *nospam* taugh.com (John Levine)
Groupes : comp.archDate : 30. Jun 2024, 19:06:36
Autres entêtes
Organisation : Taughannock Networks
Message-ID : <v5s6rc$22gn$1@gal.iecc.com>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
According to Anton Ertl <
anton@mips.complang.tuwien.ac.at>:
An application where one writes via mmap and others read
using stdio or read/write/pread/pwrite simulataneously
is poorly designed.
>
"An application"? I live in a world where all kinds of programs can
access the same files. How such a program works internally is often
not known to the designers of the others.
>
In practice your advice boils down to avoiding to write with mmap().
It's more like don't try to write shared files unless you know all of
the writers are using consistent locking. Squinting at the source code
for FreeBSD's stdio, it only flushes writes when it fills the buffer
or when it writes a \n character with the '\n' hard coded in the
source code. It doesn't lock at all other than between threads in the
same task.
You need at least as many locks and flushes to keep things in sync as
you would with mapped files.
In my experience, mmap is most often used when record-granularity
is required, rather than treating the mapped region as a
stream-of-bytes.
>
I usually mmap() the whole file.
Same here, although I have used mmap() to map a whole file as well as
for database record stuff.
* You have to extend the file length with a separate system call, and
then mmap() the new area, so you might just as well use write().
>
False economy. ftruncate is a single system call.
>
Yes, that's the one that extends the file length. ftruncate()
followed by mmap() are two system calls. And at some point you also
want to msync() (although not for each ftruncate).
Seems to me the sensible thing to do is to use ftruncate and mmap to
extend the file in large chunks, say several megabytes at a time, not
one block at a time. If you have too many system calls your chunks are
not big enough. I believe the file systems do what they do with write()
and only allocate disk blocks the first time you write to them so there
is little penalty for extending in large chunks.
-- Regards,John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",Please consider the environment before reading this e-mail. https://jl.ly
Date | Sujet | # | | Auteur |
20 Jun 24 | ARM is channeling the IBM 360 | 102 | | John Savard |
20 Jun 24 | Re: ARM is sort of channeling the IBM 360 | 95 | | John Levine |
21 Jun 24 | Re: ARM is sort of channeling the IBM 360 | 94 | | Lynn Wheeler |
24 Jun 24 | Re: ARM is sort of channeling the IBM 360 | 93 | | Lawrence D'Oliveiro |
24 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 90 | | John Levine |
24 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 87 | | Lynn Wheeler |
24 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 82 | | Lawrence D'Oliveiro |
25 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 81 | | John Levine |
25 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 73 | | Lawrence D'Oliveiro |
25 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 72 | | Stephen Fuld |
25 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 64 | | Stephen Fuld |
26 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 63 | | Stephen Fuld |
26 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 62 | | Lawrence D'Oliveiro |
26 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 57 | | John Levine |
26 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 56 | | Lawrence D'Oliveiro |
27 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 55 | | John Levine |
27 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 54 | | MitchAlsup1 |
28 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 53 | | Lawrence D'Oliveiro |
28 Jun 24 | Re: TSS I/O, ancient OS history | 1 | | John Levine |
28 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 51 | | MitchAlsup1 |
28 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 50 | | Lawrence D'Oliveiro |
29 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 49 | | Stephen Fuld |
29 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 48 | | John Levine |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 32 | | Lawrence D'Oliveiro |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | MitchAlsup1 |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 30 | | Stephen Fuld |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 24 | | Lawrence D'Oliveiro |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 22 | | Lynn Wheeler |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 21 | | John Dallman |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 19 | | Thomas Koenig |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 8 | | Michael S |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 6 | | Thomas Koenig |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 4 | | Stephen Fuld |
30 Jun 24 | Re: base registers, ancient OS history, ARM is sort of channeling the IBM 360 | 3 | | John Levine |
1 Jul 24 | Re: base registers, ancient OS history, ARM is sort of channeling the IBM 360 | 2 | | Lawrence D'Oliveiro |
1 Jul 24 | Re: base registers, ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | John Levine |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | MitchAlsup1 |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | MitchAlsup1 |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 10 | | John Dallman |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | MitchAlsup1 |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 8 | | Stephen Fuld |
30 Jun 24 | Re: small old machines, ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | John Levine |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 4 | | John Dallman |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 2 | | Stephen Fuld |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | John Dallman |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Lynn Wheeler |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 2 | | MitchAlsup1 |
1 Jul 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | moi |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Lynn Wheeler |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Stephen Fuld |
1 Jul 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 5 | | Lawrence D'Oliveiro |
2 Jul 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 4 | | John Levine |
2 Jul 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 3 | | Lawrence D'Oliveiro |
2 Jul 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 2 | | John Levine |
2 Jul 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Dan Cross |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 15 | | Anton Ertl |
30 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 14 | | Anton Ertl |
30 Jun 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling the IBM 360 | 13 | | John Levine |
1 Jul 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling the IBM 360 | 10 | | MitchAlsup1 |
1 Jul 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling | 9 | | John Levine |
1 Jul 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling | 8 | | MitchAlsup1 |
1 Jul 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling | 7 | | John Levine |
1 Jul 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling | 2 | | Lawrence D'Oliveiro |
1 Jul 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling | 1 | | John Levine |
1 Jul 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling | 4 | | Michael S |
1 Jul 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling | 3 | | MitchAlsup1 |
2 Jul 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling | 1 | | Michael S |
2 Jul 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling | 1 | | Michael S |
1 Jul 24 | Re: streams and file locks, ancient OS history, ARM is sort of channeling the IBM 360 | 2 | | Lawrence D'Oliveiro |
1 Jul 24 | Re: streams and file locks, ancient OS history | 1 | | John Levine |
26 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 4 | | Stephen Fuld |
26 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 2 | | John Levine |
26 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Stephen Fuld |
27 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | MitchAlsup1 |
26 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 7 | | John Levine |
26 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 6 | | John Levine |
27 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 5 | | Thomas Koenig |
27 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 4 | | John Levine |
27 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Thomas Koenig |
28 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Lawrence D'Oliveiro |
28 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Lawrence D'Oliveiro |
25 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 6 | | Terje Mathisen |
25 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 2 | | Lawrence D'Oliveiro |
25 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Terje Mathisen |
25 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 3 | | Michael S |
26 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 2 | | Michael S |
26 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Terje Mathisen |
25 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Lynn Wheeler |
24 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 4 | | Terje Mathisen |
24 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 2 | | Lawrence D'Oliveiro |
24 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Stephen Fuld |
24 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Thomas Koenig |
24 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 2 | | Thomas Koenig |
24 Jun 24 | Re: ancient OS history, ARM is sort of channeling the IBM 360 | 1 | | Lawrence D'Oliveiro |
24 Jun 24 | Re: ARM is sort of channeling the IBM 360 | 2 | | Stephen Fuld |
24 Jun 24 | Re: ARM is sort of channeling the IBM 360 | 1 | | Stephen Fuld |
20 Jun 24 | Re: ARM is channeling the IBM 360 | 2 | | moi |
24 Jun 24 | Re: ARM is channeling the IBM 360 | 1 | | Lawrence D'Oliveiro |
21 Jun 24 | Re: ARM is channeling the IBM 360 | 4 | | MitchAlsup1 |
22 Jun 24 | Re: ARM is channeling the IBM 360 | 3 | | John Dallman |
22 Jun 24 | Re: ARM is channeling the IBM 360 | 1 | | MitchAlsup1 |
22 Jun 24 | Re: ARM is channeling the IBM 360 | 1 | | BGB |