copy-on-write Questions
2
Making an array or dictionary a value type by definition, but then actually copying it only when one reference to it tries to modify it is a lovely idea, but it makes me wary in a multi-queued/thre...
French asked 14/8, 2020 at 15:11
2
According to mmap() manpage:
MAP_PRIVATE
Create a private copy-on-write mapping. Updates to the mapping are not visible to other processes mapping the same file, and are not carried through t...
Bullyrag asked 7/6, 2019 at 17:42
2
So I have a simple cow_ptr. It looks something like this:
template<class T, class Base=std::shared_ptr<T const>>
struct cow_ptr:private Base{
using Base::operator*;
using Base::opera...
Bluhm asked 12/10, 2017 at 2:35
1
Solved
This question contains some proposals for working around the problem, I would like to understand more in depth that exactly the problem is:
QList<QString> q;
for (QString &x: q) { .. }
...
Insula asked 10/5, 2022 at 14:36
2
Solved
I know that swift will optimize to copy on write for arrays but will it do this for all structs? For example:
struct Point {
var x:Float = 0
}
var p1 = Point()
var p2 = p1 //p1 and p2 share the ...
Chickweed asked 19/4, 2017 at 4:29
3
Solved
I've got the following function:
func checkFiles(path string, excludedPatterns []string) {
// ...
}
I'm wondering, since excludedPatterns never changes, should I optimize it by making the var g...
Nowhere asked 30/11, 2015 at 9:49
1
Solved
My filesystem (FS) (ZFS specifically) supports copy-on-write (COW), i.e. a copy (if done right) is a very cheap constant operation, and does not actually copy the underlying content. The content is...
Aphorize asked 29/12, 2020 at 12:41
2
As I continuously write data to redis, the memory used by copy-on-write keeps increasing. Even though I write my program to sleep long enough so that redis will be able to finish all the background...
Philina asked 20/4, 2014 at 16:6
9
Solved
I would like to know what copy-on-write is and what it is used for. The term is mentioned several times in the Sun JDK tutorials.
Dromond asked 10/3, 2009 at 4:27
9
Solved
I am getting an exception when I try to remove elements from CopyOnWriteArrayList using an iterator.
I have noticed that it is documented
Element-changing operations on iterators themselves (re...
Evite asked 10/4, 2011 at 14:39
1
I am writing some little script that assembles backup data into one directory. The directory content will then be uploaded to a cloud service and after that we can remove it. I was wondering how on...
Sync asked 19/12, 2019 at 15:35
7
Solved
It had been my understanding that copy-on-write is not a viable way to implement a conforming std::string in C++11, but when it came up in discussion recently I found myself unable to directly supp...
Nightmare asked 30/8, 2012 at 14:54
1
Solved
I want to use SmallVec with Cow. I tried this:
use smallvec::SmallVec;
use std::borrow::Cow;
fn main() {
let s = "hello world".to_owned();
let mut s = Cow::Borrowed(s.as_bytes());
clear_subsli...
Josefajosefina asked 3/10, 2019 at 4:44
2
Solved
Say we have a certain parent process with some arbitrary amount of data stored in memory and we use fork to spawn a child process. I understand that in order for the OS to perform copy on write, th...
Alluvion asked 13/3, 2018 at 1:3
2
Solved
I have 3 processes communicating over named pipes: server, writer, reader. The basic idea is that the writer can store huge (~GB) binary blobs on the server, and the reader(s) can retrieve it. But ...
Antoinetteanton asked 6/3, 2019 at 8:41
1
I'm trying to share objects between the parent and child process in Python. To play around with the idea, I've created a simple Python script:
from multiprocessing import Process
from os import ge...
Assistance asked 18/12, 2018 at 21:49
1
str::to_ascii_lowercase returns a String. Why doesn't it return a Cow<str> just like to_string_lossy or String::from_utf8_lossy?
The same applies to str::to_ascii_uppercase.
Sheriff asked 17/8, 2018 at 11:30
2
When we malloc memory, only virtual memory is available, and it actually pointed to zero-page. The real physical memory will be allocated when we try to write to the malloced memory, at this moment...
Adenosine asked 7/7, 2017 at 10:27
1
Solved
I have a directory containing source code, which I compile to produce object files. I want to quickly apply a patch and rebuild in such a way that I have simultaneous access to both the old and new...
Reiner asked 2/3, 2015 at 16:48
1
Solved
As the title said, I tried to prove myself that COW(copy on write) is supported for String in Swift. But I cannot find a proof. I proved the COW on Array and Dictionary after trying the following c...
Garderobe asked 14/10, 2017 at 17:26
1
Solved
I read about copy-on-write implementation for Array in Swift here.
Arrays, like all variable-size collections in the standard library, use copy-on-write optimization. Multiple copies of an array...
Heartless asked 22/7, 2017 at 9:57
1
Solved
I am trying to create a QList of a polymorphic type that still uses Qt's implicit sharing.
My specific use case is passing items held in a QList to QtConcurrent::mapped. The items all descend fro...
Granth asked 16/6, 2017 at 15:44
3
Solved
I have a very large structure, which I want to ensure is not copied needlessly. How can I make a copy-on-write container for it?
Chromo asked 7/10, 2015 at 5:12
1
I am trying to understand this dirty CoW proof of concept: https://github.com/dirtycow/dirtycow...ter/dirtyc0w.c.
What happens when a child thread (procselfmemThread in the link above) writes to m...
Inexecution asked 1/11, 2016 at 15:19
3
I want to have the advantage of functional data structures (multiple versions of data that can share structure) but be able to modify it in an imperative style.
What I'm thinking about (and a pos...
Biome asked 4/9, 2009 at 21:19
1 Next >
© 2022 - 2024 — McMap. All rights reserved.