FIND YOUR NEXT FEW LINES

Results for “atomic”

Small, practical examples. Search by task or narrow things down below.

12 snippets foundClear filters
Arduino / CDigital signals & interrupts

Copy a multibyte interrupt-owned counter atomically

Arduino / C: ATOMIC_RESTORESTATE restores the interrupt state after reading a shared value.

Arduino / C✓ Tested
C#Asynchronous work & URI handling

Increment a shared counter atomically

C#: Interlocked performs an indivisible update without a separate lock for this operation.

C#✓ Tested
GoConcurrency & cancellation

Increment an atomic counter

Increment an atomic counter using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsFiles & reliability

Replace a text file with an atomic rename

Prepare new content beside the target before renaming it into place.

atomic write✓ Tested
SQLSchema design & transactions

Undo a multi-row transfer atomically

SQL: The first transaction commits the fixtures. Rolling back the second transaction restores both sides of the attempted transfer.

SQL✓ Tested
SQL ServerSchema design & transactions

Undo a multi-row transfer atomically

SQL Server: The first transaction commits the fixtures. Rolling back the second transaction restores both sides of the attempted transfer.

SQL Server✓ Tested
PostgresSchema design & transactions

Undo a multi-row transfer atomically

Postgres: The first transaction commits the fixtures. Rolling back the second transaction restores both sides of the attempted transfer.

Postgres✓ Tested
SQLiteSchema design & transactions

Undo a multi-row transfer atomically

SQLite: The first transaction commits the fixtures. Rolling back the second transaction restores both sides of the attempted transfer.

SQLite✓ Tested
JavaRecords & reliable control flow

Update a shared counter atomically

Java: AtomicInteger provides an indivisible increment operation for a shared counter.

Java✓ Tested
RustThreads & shared ownership

Update an atomic counter

Update an atomic counter in a complete Rust program using the standard library.

Rust✓ Tested
C++Tasks & synchronization

Increment a shared counter safely

C++: Atomic increments prevent lost updates when two threads change the same counter.

C++✓ Tested
Arduino / CDigital input & output

Count a falling edge with an interrupt

Increment a counter when an external input changes.

attachInterrupt✓ Tested