Haiku Atomic Operations: Value Updates, Ordering, and Publication
Use Haiku atomic operations with the correct return-value and acquire/release semantics, while avoiding compound-state races and false lock-free guarantees.
tag
13 posts
Use Haiku atomic operations with the correct return-value and acquire/release semantics, while avoiding compound-state races and false lock-free guarantees.
Use Haiku BBlockCache for reusable fixed-size blocks while managing fallback allocations, matching frees, cache capacity, and mutex contention.
Design safe Haiku BFlattenable types with explicit type codes, bounded parsing, versioned payloads, and compatibility distinct from BArchivable.
Use Haiku BStopWatch for quick elapsed-time checks while accounting for microseconds, destructor output, lap limits, and profiling bias.
Use Haiku TLS keys as process-wide slots for per-thread state, with checked allocation, explicit initialization, pointer ownership, and thread cleanup.
Handle Haiku BDataIO short reads and writes, choose exact-transfer helpers, and use BBufferedDataIO, BMemoryIO, and BMallocIO with explicit ownership.
Use Haiku BSupportKit jobs as explicit work state machines, understand synchronous Run semantics, and coordinate listeners and prerequisites safely.
Use Haiku BLocker and BAutolock with correct recursion, timeout, and object-lifetime rules to prevent deadlocks in multithreaded applications.
Use Haiku BObjectList with explicit ownership, checked insertion, safe removal, stable identity, and predictable copying under allocation failure.
Use Haiku BReference and BReferenceable for explicit shared object lifetimes, transfer semantics, final release, and thread-safe ownership boundaries.
Use Haiku BString safely by separating byte lengths from UTF-8 character offsets, managing borrowed buffers, and testing mutation boundaries.
Manage Haiku text collections with BStringList ordering, checked mutation, search, sorting, joining, flattening, and explicit persistence schemas.
Use Haiku BUrl to parse URI components, resolve relative references, encode individual components, and validate syntax without confusing it with reachability.