From 2ced7188f08eae7dce8c11da07e91862ec3790d5 Mon Sep 17 00:00:00 2001 From: Dan Kaplun Date: Mon, 14 May 2018 21:39:46 -0400 Subject: [PATCH 1/2] Update repo URL --- readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index a655bf4..61bb524 100644 --- a/readme.md +++ b/readme.md @@ -1,28 +1,28 @@ Atom ==== -[![Build Status](https://travis-ci.org/slide-rs/atom.svg?branch=master)](https://travis-ci.org/csherratt/atom) +[![Build Status](https://travis-ci.org/slide-rs/atom.svg?branch=master)](https://travis-ci.org/slide-rs/atom) [![Atom](http://meritbadge.herokuapp.com/atom)](https://crates.io/crates/atom) `Atom` is a simple abstraction around Rust's `AtomicPtr`. It provides a simple, wait-free way to exchange data between threads safely. `Atom` is built around the principle that an atomic swap can be used to safely emulate Rust's ownership. -![store](https://raw.githubusercontent.com/csherratt/atom/master/.store.png) +![store](https://raw.githubusercontent.com/slide-rs/atom/master/.store.png) Using [`store`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.store) to set a shared atomic pointer is unsafe in rust (or any language) because the contents of the pointer can be overwritten at any point in time causing the contents of the pointer to be lost. This can cause your system to leak memory, and if you are expecting that memory to do something useful (like wake a sleeping thread), you are in trouble. -![load](https://raw.githubusercontent.com/csherratt/atom/master/.load.png) +![load](https://raw.githubusercontent.com/slide-rs/atom/master/.load.png) Similarly, [`load`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.store) is unsafe since there is no guarantee that that pointer will live for even a cycle after you have read it. Another thread may modify the pointer, or free it. For `load` to be safe you need to have some outside contract to preserve the correct ownership semantics. -![swap](https://raw.githubusercontent.com/csherratt/atom/master/.swap.png) +![swap](https://raw.githubusercontent.com/slide-rs/atom/master/.swap.png) A [`swap`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.swap) is special as it allows a reference to be exchanged without the risk of that pointer being freed, or stomped on. When a thread From 5986c3a6e0d36daba139a6be5508a2ed29f8c984 Mon Sep 17 00:00:00 2001 From: Dan Kaplun Date: Mon, 14 May 2018 21:40:53 -0400 Subject: [PATCH 2/2] mv *.png assets/ --- .load.png => assets/load.png | Bin .store.png => assets/store.png | Bin .swap.png => assets/swap.png | Bin readme.md | 6 +++--- 4 files changed, 3 insertions(+), 3 deletions(-) rename .load.png => assets/load.png (100%) rename .store.png => assets/store.png (100%) rename .swap.png => assets/swap.png (100%) diff --git a/.load.png b/assets/load.png similarity index 100% rename from .load.png rename to assets/load.png diff --git a/.store.png b/assets/store.png similarity index 100% rename from .store.png rename to assets/store.png diff --git a/.swap.png b/assets/swap.png similarity index 100% rename from .swap.png rename to assets/swap.png diff --git a/readme.md b/readme.md index 61bb524..54bd2e2 100644 --- a/readme.md +++ b/readme.md @@ -8,21 +8,21 @@ Atom data between threads safely. `Atom` is built around the principle that an atomic swap can be used to safely emulate Rust's ownership. -![store](https://raw.githubusercontent.com/slide-rs/atom/master/.store.png) +![store](https://raw.githubusercontent.com/slide-rs/atom/master/assets/store.png) Using [`store`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.store) to set a shared atomic pointer is unsafe in rust (or any language) because the contents of the pointer can be overwritten at any point in time causing the contents of the pointer to be lost. This can cause your system to leak memory, and if you are expecting that memory to do something useful (like wake a sleeping thread), you are in trouble. -![load](https://raw.githubusercontent.com/slide-rs/atom/master/.load.png) +![load](https://raw.githubusercontent.com/slide-rs/atom/master/assets/load.png) Similarly, [`load`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.store) is unsafe since there is no guarantee that that pointer will live for even a cycle after you have read it. Another thread may modify the pointer, or free it. For `load` to be safe you need to have some outside contract to preserve the correct ownership semantics. -![swap](https://raw.githubusercontent.com/slide-rs/atom/master/.swap.png) +![swap](https://raw.githubusercontent.com/slide-rs/atom/master/assets/swap.png) A [`swap`](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.swap) is special as it allows a reference to be exchanged without the risk of that pointer being freed, or stomped on. When a thread