SELECT FOR UPDATE considered harmful in PostgreSQL

This article tells you why SELECT FOR UPDATE is almost always the wrong lock and that you should use SELECT FOR NO KEY UPDATE instead.

CYBERTEC PostgreSQL | Services & Support

Concurrency Concept: Say you have two threads trying to access the same bytes.
Instead of a lock, both threads can reserve a specific time interval, in which they are allowed to access the memory area. So the access timeline would look something like this (t1 and t2 being the timeframe's the respective threads can access it): t1 | t2 | t1 | t2 | ...

#programming #concurrency #parallel #parallelism

"The best way to approach concurrency is to master the fundamentals" #scala #concurrency https://lukastymo.com/posts/022-concurrency-basic-synchronization/
[Scala] Fundamental Concurrency Problems and Solutions

The best way to approach concurrency is to master the fundamentals. Below is a small collection of foundational concurrency problems with practical solutions using Scala and Cats Effect. Conclusion In this post, we explore four fundamental concurrency problems and their idiomatic solutions using Scala and Cats Effect, but which could be generalized to any programming language with concurrency support. After reading this post, you should be able to: Mutex for synchronizing access to shared resources Semaphore for limiting the number of concurrent tasks CyclicBarrier for synchronizing tasks at a common point CountDownLatch for waiting for a signal before proceeding with tasks Problem 1: Counter Updated in Parallel (Mutex) ❌ The Problem Suppose we have a simple counter that is incremented by 1000 tasks running in parallel. Without synchronization, we get incorrect results.

On the Way to Another Dawn

@noboilerplate THIS!

I think a lot of people inadvertently assume async #RustLang is so different from sync Rust, because the way it is - when in fact it's because of the (most popular) async runtime they're using.

We should look way more into alternative #async runtimes to #Tokio, e.g. smol:

https://floss.social/@janriemer/111669258656959538

#Smol allows you to use non-'static Futures by using a local executor:

https://floss.social/@janriemer/111669668856899636

It looks a lot more like "normal" #Rust.

#RustAsync #AsyncRust #Concurrency

Jan :rust: :ferris: (@janriemer@floss.social)

Yay! @notgull@hachyderm.io is working on `smol` integration with #axum! :awesome: https://github.com/notgull/smol-axum The smol #async runtime: https://github.com/smol-rs/smol #Tokio is not the end-all-be-all runtime. You should keep looking at alternatives and what unique features they can offer. ✨ Don't be blinded by "if it is the most popular, it must be the best" fallacy. #Rust #RustLang #RustAsync #AsyncRust

FLOSS.social

Paging #Swift #Concurrency experts! Is there any way to leverage KVO to synchronously update a property in one class in response to a change in another?

Note that both `MyClass` and `AVPlayer` are `@MainActor`, so I think this should be a safe thing to want to do... I just don't know how to do it!

cc @mattiem

EDIT: is this a good use case for `MainActor.assumeIsolated`?

Faster Python: Concurrency in async/await and threading | The PyCharm Blog

Want to write faster Python code? Discover the difference between `async/await` and `threading` and how concurrency works in Python with real-world examples.

The JetBrains Blog
The Concurrency Trap: How An Atomic Counter Stalled A Pipeline - Conviva

Discover how a single atomic counter caused a major slowdown in Conviva's high-scale streaming analytics platform. This post unpacks the concurrency pitfalls behind a mysterious latency spike and offers lessons for Rust developers working with DAGs, actor models, and shared state.

Conviva
Faster Python: Concurrency in async/await and threading | The PyCharm Blog

Want to write faster Python code? Discover the difference between `async/await` and `threading` and how concurrency works in Python with real-world examples.

The JetBrains Blog

GPUMC: A Stateless Model Checker for GPU Weak Memory Concurrency

#OpenCL #CUDA #Concurrency #Memory #ModelCheck

https://hgpu.org/?p=29921

GPUMC: A Stateless Model Checker for GPU Weak Memory Concurrency

GPU computing is embracing weak memory concurrency for performance improvement. However, compared to CPUs, modern GPUs provide more fine-grained concurrency features such as scopes, have additional…

hgpu.org
GitHub - cmu-pasta/fray: A controlled concurrency testing framework for the JVM

A controlled concurrency testing framework for the JVM - cmu-pasta/fray

GitHub