hazard pointer synchronous reclamation1 Basic Hazard Pointer Algorithm read pointer A from SRC remove A from SRC 1 5 4 Safe to use pointer A SRC A hazard pointer is a single-writer multi-reader pointer. set HP to A if SRC == A clear ACCESS If a hazard pointer points to an object before its removal, then the object will not be reclaimed as long as the hazard pointer remains unchanged unchanged. *A Hazard Pointer Synchronous Reclamation Beyond Concurrency TS2 – Maged Michael Protector Remover / Reclaimer Hazard pointers protect access to objects that may be removed concurrently. SAFE RECLAMATION0 码力 | 31 页 | 856.38 KB | 6 月前3
Back to Basics: Pointerslanguage. In this talk, we will discuss the low level foundations of what a raw pointer is--a variable that stores an address. We will then see some examples of raw pointers for creating data structures leave understanding how we can use pointers in a safe manner through the standard library smart pointer abstractions. 4 The abstract that you read and enticed you to join me is here!Code for the talk and more on: www.mshah.io 6One of my fondest programming memories was... 7... when I used a pointer correctly on the first try 8 ● And maybe as a C or C++ programmer you have a similar memory or0 码力 | 152 页 | 5.61 MB | 6 月前3
Plug-in Based Software Architecture for Roboticsnow have loaded the shared object into memory using dlopen(). ● We can use dlsym() to obtain address of a function in the shared object ○ GetProcAddress in Windows 24Add function in implementation of the implementation class using dlsym // create simple motion planner instance is a function pointer which points to any function that takes // in no arguments and returns a IMotionPlanner type. using *simple_motion_planner_so = dlopen("/path/to/simple_motion_planner.so", RTLD LAZY); // Use dlsym to obtain address of function createInstance. This result is then casted to type create_simple_motion_planner_instance0 码力 | 75 页 | 2.40 MB | 6 月前3
Class Layoutfor an (n+1)-argument free function. Some platforms use a special calling sequence for the this pointer that may be marginally more efficient. void terminate(HR *, Salary *); void terminate(HR *, Hourly Layout Copyright © 2020 by Stephen C. Dewhurst and Daniel Saks 7 …Until C++20! The no_unique_address attribute allows an empty non-static data member to share space with another subobject (base class Empties { // sizeof(Empties) is now probably 1 [[no_unique_address]] Empty e1_; [[no_unique_address]] Empty2 e2_; [[no_unique_address]] Empty3 e3_; }; 18 Copyright © 2020 by Stephen C. Dewhurst and0 码力 | 51 页 | 461.37 KB | 6 月前3
Hidden Overhead of a Function APIunique_ptrto transfer ownership where a pointer is needed Reason Using unique_ptr is the cheapest way to pass a pointer safely. 40Returning a pointer #include int* raw_ptr() { return nullptr; } std::unique_ptr smart_ptr() { return nullptr; } - returning raw pointer - returning smart pointer 41 https://godbolt.org/z/ExaoKfT1zarmv8-a clang 18.1.0 x86-64 gcc 14.2 x64 msvc v19 storage available on a machine. Register in square brackets means it stores an address, and we’re accessing memory at that address: [x8], QWORD PTR [rdi]Quick benchmark https://quick-bench.com/q/pJ3z9L_Q1M16qob8-sg8lM3-T60 0 码力 | 158 页 | 2.46 MB | 6 月前3
Using Modern C++ to Build XOffsetDatastructurecompatibility. • However, we're not entirely disregarding compatibility. We have some attempts to address compatibility issues, which we'll discuss later in the presentation. Fanchen Su, XOffsetDatastructure pointers. • Absolute pointers represent the actual address in virtual memory. • Relative or Offset pointers represent an offset from an absolute start address (often called the "base"). Fanchen Su, XOffsetDatastructure pointers. • Absolute pointers represent the actual address in virtual memory. • Relative or Offset pointers represent an offset from an absolute start address (often called the "base"). • Smaller and Movable0 码力 | 111 页 | 3.03 MB | 6 月前3
Back To Basics Functionsminimum means we need to store a return address ■ We also may need to copy or otherwise access arguments. ■ The combination of the arguments and return address make up part of the stack frame ● (Note: functions (Call stack) ● When you call a function recall that the arguments are copied and the return address. ○ Any local variable are also stored on the call stack as well. ● If a function calls another this from our previous dive into assembly ○ Functions have an ‘address’ where they are stored in memory. ■ This means we can take the ‘address’ of a function ● (e.g. &add). ■ But before we get into that0 码力 | 123 页 | 7.26 MB | 6 月前3
Back To Basics Debuggingmakes bugs hard to fix? Non-deterministic ‘Heisenbugs’Different kinds of bug ● Logic bugs ● Pointer errors ● Error handling ● Race conditions ● Interface assumptions ● Unitialised variables ● ● Essentially a compiler feature: ○ Much faster runtime ○ Knows more stuffSo many sanitizers… address float-cast-overflow nonnull-attribute returns-nonnull-attribute unreachable integer-divide-by-zero pointer-compare bounds-strict kernel-address pointer-overflow builtin kernel-hwaddress pointer-subtract enum0 码力 | 32 页 | 1.48 MB | 6 月前3
Back To Basics Debugging and Testingmakes bugs hard to fix? Non-deterministic ‘Heisenbugs’MANY DIFFERENT KINDS OF BUG ● Logic bugs ● Pointer errors ● Error handling ● Race conditions ● Interface assumptions ● Platform incompatabilities ● Essentially a compiler feature: ○ Much faster runtime ○ Knows more stuffSO MANY SANITIZERS… address float-cast-overflow nonnull-attribute returns-nonnull-attribute unreachable integer-divide-by-zero pointer-compare bounds-strict kernel-address pointer-overflow builtin kernel-hwaddress pointer-subtract enum0 码力 | 50 页 | 2.04 MB | 6 月前3
POCOAS in C++: A Portable Abstraction for Distributed Data StructuresRemote Pointer Types Building Distributed Data Structures Extending to GPUsThis Talk Background: how do we write a program for a supercomputer? Introduce PGAS Model, RDMA Building Remote Pointer Types Remote Pointer Types Building Distributed Data Structures Extending to GPUsThis Talk Background: how do we write a program for a supercomputer? Introduce PGAS Model, RDMA Building Remote Pointer Types Background: how do we write a program for a supercomputer? Introduce PGAS Model, RDMA Building Remote Pointer Types Building Distributed Data Structures Extending to GPUsWhat This Talk Is Not - A distributed0 码力 | 128 页 | 2.03 MB | 6 月前3
共 253 条
- 1
- 2
- 3
- 4
- 5
- 6
- 26













