bossmc / pinboard Goto Github PK
View Code? Open in Web Editor NEWA threadsafe way to publish data, just stick it on the pinboard
License: MIT License
A threadsafe way to publish data, just stick it on the pinboard
License: MIT License
Would make creating Pinboard
s easier in some cases
When storing data in a pinboard, if the contents are replaced, the old data does not have the destructors called, this leads to a memory leak.
I have attached a crate which demonstrates the issue, this can be verified by running valgrind against the example (using nightly-2017-07-06 as later versions seem to be broken).
I think, in set()
and clear()
, it's necessary to swap self.0
with the AcqRel
ordering (instead of Release
). Because otherwise, guard.unlinked(t)
is not necessarily happening after the initialization of the data contained in t
.
For example, suppose that an invocation "A" of set()
writes a value t
and another invocation "B" of set()
is replacing t
. Then B's invocation of guard.unlinked(t)
should happen after A's invocation of Owned::new(t)
. However, with only Release
ordering we cannot guarantee that.
By the way, thank you for building this wonderful library. I needed pinboard in building a new version of Crossbeam, so I reimplemented it with the name AtomicBox
: https://github.com/jeehoonkang/crossbeam-epoch/blob/hazard-pointer/src/sync/atomic_box.rs (warning: no documentation at all yet!) I'll properly acknowledge the pinboard crate before submitting it as a PR to crossbeam-epoch
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.