Programming Persistent Memory by Steve Scargall
Author:Steve Scargall
Language: eng
Format: epub, pdf
ISBN: 9781484249321
Publisher: Apress
Nonpersistent Stores
Nonpersistent stores refer to data written to persistent memory but not flushed explicitly. It is understood that if the program writes to persistent memory, it wishes for those writes to be persistent. If the program ends without explicitly flushing writes, there is an open possibility for data corruption. When a program exits gracefully, all the pending writes in the CPU caches are flushed automatically. However, if the program were to crash unexpectedly, writes still residing in the CPU caches could be lost.
Consider the code in Listing 12-7 that writes data to a persistent memory device mounted to /mnt/pmem without flushing the data. 32 #include <stdio.h>
33 #include <sys/mman.h>
34 #include <fcntl.h>
35
36 int main(int argc, char *argv[]) {
37 int fd, *data;
38 fd = open("/mnt/pmem/file", O_CREAT|O_RDWR, 0666);
39 posix_fallocate(fd, 0, sizeof(int));
40 data = (int *) mmap(NULL, sizeof(int), PROT_READ |
41 PROT_WRITE, MAP_SHARED_VALIDATE |
42 MAP_SYNC, fd, 0);
43 *data = 1234;
44 munmap(data, sizeof(int));
45 return 0;
46 }
Download
Programming Persistent Memory by Steve Scargall.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Linux Device Driver Development Cookbook by Rodolfo Giometti(3930)
Embedded Programming with Modern C++ Cookbook by Igor Viarheichyk(3567)
Implementing Cellular IoT Solutions for Digital Transformation by Dennis McCain(3501)
Embedded Linux Development Using Yocto Project - Third Edition by Otavio Salvador & Daiane Angolini(3332)
TinyML Cookbook by Gian Marco Iodice(3279)
Simplifying 3D Printing with OpenSCAD by Colin Dow(2836)
TinyML Cookbook by Gian Marco Iodice & Ronan Naughton(2599)
Fusion 360 for Makers by Lydia Sloan Cline(2218)
Networking A Beginner's Guide by Bruce Hallberg(2206)
Hands-On Linux for Architects by Denis Salamanca(2049)
But How Do It Know? by J. Clark Scott(2028)
Computers For Seniors For Dummies by Nancy C. Muir(1995)
Raspberry Pi and MQTT Essentials by Dhairya Parikh(1948)
Arduino Project Handbook, Volume 2: 25 Simple Electronics Projects for Beginners by Geddes Mark(1943)
9781803246888-ENHANCING DEEP LEARNING WITH BAYESIAN INFERENCE by Unknown(1895)
Hack and HHVM by Owen Yamauchi(1882)
31 Days Before Your CompTIA A+ Exams (Shanette Luellen's Library) by Benjamin Patrick Conry(1857)
MicroPython Projects by Jacob Beningo(1725)
Hands-On Internet of Things with MQTT by Tim Pulver(1702)
