Category "concurrency"

Reentrant lock not updating the shared resource properly

I have a shared variable count, which I am incrementing in increment() method and two threads are access this. I'm getting the wrong final count. Here is the s

Are indexes built CONCURRENTLY different in any way?

Does PostgreSQL CREATE INDEX CONCURRENTLY mean that even after initial index build, new and future inserts won't be indexed immediately (strongly consistent in

async/await, Task and [weak self]

Okay so we all know that in traditional concurrency in Swift, if you are performing (for example) a network request inside a class, and in the completion of tha

Spring-batch flow / split after a step

I am building a spring-batch solution that contains the following process: step 1 : split a list into multiple lists step 2 : process each sub-list step 3 :

how to make Goroutine not Concurrency if Same Function

Is there any way to make goroutine execute one after another ( one by one) if it was the same function? I didn't mean to use goroutine firstly. However, "os/exe

Can using volatile affect the behavior of simple property checking system?

I'm maintaining a project where someone has suggested that we make some variables volatile. I'm trying to understand if it's needed at all (or could be needed).

Mutex in WRK lua script

I have the following script in Lua (custom.lua): local data = loadFile() local count = -1 request = function() url_path = "/resource" -- lock count

Load data from reading files during startup and then process new files and clear old state from the map

I am working on a project where during startup I need to read certain files and store it in memory in a map and then periodically look for new files if there ar

How to address the "Lock was destructed while held" Visual C++ runtime assertion

In a program that uses DirectX to render a 3D component I use a dedicated rendering thread that apparently gets created if I call DispatcherQueueController::Cre

MySQL slow concurrent/parallel queries in Python

We are using very simple SELECT … WHERE queries (1000 rows, from a very small table with 18000 entries) to load time series data for plotting (for testin

Recursive calls from function started as goroutine & Idiomatic way to continue caller when all worker goroutines finished

I am implementing a (sort of a) combinatorial backtracking algorithm in go utilising goroutines. My problem can be represented as a tree with a certain degree/s

Why doesn't my multi-process writing program trigger concurrent conflict?

I'm trying to trigger some concurrent conflicts by having several processes writing to the same file, but couldn't: #include <stdio.h> #include <stdlib

Can double checked locking be abstracted/simplified?

My company uses double checked locking all over the place in our code. Because it is so pervasive - and so verbose - I was wondering if there is a good way to a

Are function variables concurrency-safe in golang?

I have following types declared type TestFn func(id int, ctx context.Context) error var Func1 = TestFn(func(id int, ctx context.Context) error { // do some w

Modifying JSONObject in java , getting exception of ConcurrentModificationException

I have to modify each value for key inside JSONObject and I'm using recursion to iterate over JSONObject because it can be nested. But I'm getting exception in

Difference between Isolate vs Thread vs Process?

As we know flutter app runs in an isolates. Somewhere I read that isolates are not system processes. So what really an isolate is and how it's different from pr

std::future<T>::wait returns compile error in msvc

Using the msvc with the /std::c++20 flag on, I can't seem to get the wait call compiled. simple example: #include<future> std::future<int> fut = st

Issue sharing array between goroutines

I am trying to solve this golang exercise https://github.com/loong/go-concurrency-exercises/tree/master/1-producer-consumer. I guess I am close to the solution

How does OpenMP actually reduce clock cycles?

It might be a silly question but, with OpenMP you can achieve to distribute the number of operations between all the cores your CPU has. Of course, it is going

Is this INSERT statement containing SELECT subquery safe for multiple concurrent writes?

In Postgres, suppose I have the following table to be used like to a singly linked list, where each row has a reference to the previous row.