Sujet : Re: ancient OS history, ARM is sort of channeling the IBM 360
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.archDate : 30. Jun 2024, 17:38:10
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2024Jun30.183810@mips.complang.tuwien.ac.at>
References : 1 2 3 4 5 6 7
User-Agent : xrn 10.11
scott@slp53.sl.home (Scott Lurndal) writes:
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
John Levine <johnl@taugh.com> writes:
As I think I said before, these days you map the file into your
address space and read or write it like a long string, so its all
locate all the time.
>
Reading with mmap() appears to be quite common, either directly or
through libaries like glibc which use mmap() for buffered input where
possible. For writing, using mmap() poses some difficulties:
>
* Writing to an mmap()ed region has weaker atomicity semantics than
write().
>
That depends - if all writers are using mmap, atomicity is provided
by other mechanisms (process-scope mutex, sysv or posix semaphores,
etc).
>
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().
>
>
* mmap() works on pages (not in the interface, fortunately, but
internally), but for writing you want byte granularity. The
difference is not a big problem for reading, but it is a bigger one
for writing.
>
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.
* 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).
- anton
-- 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.' Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
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 |