Home >


  • Writable Atomic property - cannot pair a synthesized getter with a user defined setterJanuary 10

    I have defined an atomic attributed property in my application but now find a new to override the setter so as to update some UI element whenever it is changed. However, I get the aforementioned warning. Is there a way to nullify this warning or if n

  • Linking pthread disables lock-free shared_ptr implementationFebruary 17

    The title pretty much conveys all relevant information, but here's a minimal repro: #include <atomic> #include <cstdio> #include <memory> int main() { auto ptr = std::make_shared<int>(0); bool is_lockless = std::atomic_is_lock_free

  • OpenMP atomic and non-atomic reads/writes produce the same instructions on x86_64February 17

    According to the OpenMP Specification (v4.0), the following program contains a possible data race due to unsynchronized read/write of i: int i{0}; // std::atomic<int> i{0}; void write() { // #pragma omp atomic write // seq_cst i = 1; } int read() {

  • Frontend workflow with Grunt, Bootstrap and Jekyll [on hold]February 13

    Any ideas for a front end workflow with: - Grunt or Gulp - as task manager with minified, gruticon and others plugins; - Bootstrap SASS as a CSS framework; - Jekyll, for templating, with includes and partials; - Atomic Design approach, since we want

  • How does xchg like instructions on an uniprocessor negatively affect the pipeline ? (IA32)February 11

    I know how using xchg can negatively affect a multiprocessor by causing high cache coherence traffic. I would like to know how it can affect instrcution pipeline on an uniprocessor.

  • Atomic operation on read/write variable in javaFebruary 10

    I have a java class as below: public class Example implements Runnable { private int num; ... // Getter public int getNum(){ return this.num; } // Setter public void addToNum(int amount) { if (this.amount> 0) { this.num += amount; } } ... } This clas

  • Are append operations on an AppendBlob atomic?February 9

    I am using append blob to store a large binary file. I've got the file in parts (every part is less than 4 MB) and append them to make it whole again. If an append operation fails during the process, are there any remains on the file from this failed

  • Benefits & drawbacks of as-needed conditional std::atomic_thread_fence acquire?February 8

    The code below shows two ways of acquiring shared state via an atomic flag. The reader thread calls poll1() or poll2() to check for whether the writer has signaled the flag. Poll Option #1: bool poll1() { return (flag.load(std::memory_order_acquire)

  • Is the write operation of socketpair atomic?February 6

    Please see atomic write of pipe, the Unix domain socket socketpair() perform much like bi-directional pipe so my question is: Is the write operation of socketpair is atomic? (I saw some source code that multiple write into same fd of socketpair in di

  • Are C/C++ fundamental types atomic?February 5

    Are C/C++ fundamental types, like int, double, etc., atomic, e.g. threadsafe? Are they free from data races; that is, if one thread writes to an object of such a type while another thread reads from it, is the behavior well-defined? If not, does it d

  • generate temporary file to replace real fileFebruary 5

    I need to generate a temporary file to replace a system file with new contents. I have the code, and it works, but I was thinking if there is some module that automatically does that, along the lines of: with tempfile.NamedTemporaryFileFor('/etc/syst

  • CUDA atomics causes branch divergenceFebruary 2

    I'm developing a CUDA kernel to compute the histogram of an image (NVIDIA GTX 480). I've noticed using the cuda profiler that an 82.2% of branch divergence was found. The profiler indicates the following function as the source of the divergence, loca

  • Synchronize queue IPC over shared memory wtih gcc atomicsFebruary 2

    I've been reading about atomics a lot and I'm not sure I fully understand their implementation in C. I have a producer-consumer relationship, and the data must be fed from one process to another. The producer is Valgrind, which doesn't allow me to us

  • std::atomic as a value of std::mapJanuary 29

    I want to use atomic variable in a map. I am using Visual Studio 2012 (msvc-11) and gcc 4.7. I have defined a type: typedef std::map<uint64_t, std::atomic<int64_t>> value_map_t; In msvc-11, lines value_map_t map; map[1] = 0; produce error: err

  • Why is the compiler loading this pointer from memory in a loopJanuary 29

    I am trying to determine what overhead std::atomic introduces to unconditional memory writes on my system (eight-core x64). Here is my benchmark program: #include <atomic> #include <iostream> #include <omp.h> int main() { std::atomic_int

  • Atomic operations on `unique_ptr`January 28

    std::shared_ptr has specializations for atomic operations like atomic_compare_exchange_weak and family, but I cannot find documentation on equivalent specializations for std::unique_ptr. Are there any? If not, why not? --------------Solutions--------

  • Is having a lot of atomics a good/bad?January 25

    This question is related to my previous. I did some tests and figured out that having array full of atomics is much MUCH faster than my previous approach with mutexes. But is it ok to have millions of them? Maybe there's something I simply don't know

  • Is a comparison operation thread safe for std::atomic variables?January 22

    std::atomic has some operators like: +, -, ++, -- (post and pre) and guarantee that they are thread safe, but is comparison operations thread safe? I mean following: std::atomic<int> a = 10; int i = 20; void func() { a++; // atomic and thread safe i

  • Extend C# Dictionary for Atomic AddOrUpdate

    Extend C# Dictionary for Atomic AddOrUpdateJanuary 21

    Previously I asked a question on Atomic AddOrUpdate on C# Dictionary. Basically the answer I got was to extend C# Dictionary implementation, which I found it quite rational. I extended the Dictionary implementation as was suggested, however, the perf

  • How to enforce std::atomic to be read after other std::atomic has been written?January 20

    I have two threads, Producer and Consumer. Data exchange is controlled by two pointers inside std::atomics: std::atomic<TNode*> next = nullptr; std::atomic<TNode*> waiting = nullptr; Thread Producer publishs the prepared data and afterwards ch

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.470 s.