Code $ g++ main.cpp -ltbb -lpthread Future Switch to a thread pool to execute the different calculations in parallel.
Continue readingCategory: Programming
Memory order for atomics (C++)
Overview Memory order Description memory_order_relaxed Unsafest, No ordering is guaranteed. memory_order_acquire A load operation, No reads or writes in the
Continue readingRandom number generation (C++)
Let’s generate 10 integers with a uniform distribution between 1 and 6. Historic approach Only uniform distribution provided. 👎 Modern
Continue readingParallelize without own threading (oneTBB)
oneTBB The library abstracts all the thread handling from you, like the task scheduler and its thread pool. Features (selection)
Continue readingHow to pass arguments (C++)
Analysis Code â–¼ Output â–¼ Constructor: bar_0 Not store copy run_copy_no_store Constructor: bar_1 === lvalue === Copy Constructor: bar_1 ===
Continue readingMutable vs. Immutable (Python)
Immutable data types They are not modifiable e.g. Numbers, Strings and Tuples Before line 3 a —> 1 b —–^
Continue readingstd::forward with concept (C++)
Introduction std::forward: Keeps the type of the reference. (lvalue, rvalue) concept: Specifies requirements for the template type. Example $ g++
Continue readingBackward and Forward compatibility (API)
Showcase API (in protobuf) message User { string name = 1; int32 id = 2; } Backward compatibility If you
Continue readingCache friendly code
Example Analysis The array will be stored in memory like this: [row_0, col_0] … [row_0, col_999] … [row_999, col_0] …
Continue reading