Category "concurrency"

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.

How can some architectures guarantee that aligned memory operations are atomic?

As explained in this post: Why is integer assignment on a naturally aligned variable atomic on x86? : Memory load/store on a byte value - and any correctly alig

Running jest tests in parallel based on a list of parameters

In my case I have a test file containing a few hundred tests using jest describe('my test-suite', () => { test('test 1', () => { expect(1).toBe(

How to prevent a Cronjob execution in Kubernetes if there is already a job running? concurrencyPolicy:Forbid stops the cron job execution altogether

I need a cron job to run every 5 minutes. If an earlier cron job is still running, another cron job should not start. I tried setting concurrency policy to Forb

Edited: Retrofit and CompletableFuture, is there a way to not rely on the underlying connection pool?

Original question: OkHttp, is there a way to not rely on a connection pool? Hey OkHttp users and/or contributors! Is there a way to use an OkHttpClient withou

Two concurrent saveAll actions with a unique constraint

I am not using any type of locking. Is it possible that two concurrent saveAll requests trying to save the same set of records could collide with each other and

JavaFX thread should wait for background thread but without freezing the UI (JavaFX)

I want my main thread to wait until the background thread completes. But, this makes my UI freeze. I want to achieve this without freezing my UI. Please help me

Why is sleep in a child process blocking my program?

So I have this simple program that sleeps for 4 second if the value returned by fork is '0' meaning that the child process is executing, I've tried using sleep

Mutex does not seem to be locking properly

I am just learning about mutexess. I thought the following program would return a total of 1000, but I am getting varied results, so I assume I am doing someth

Is Apache EventListenerSupport thread safe?

Summary The org.apache.commons.lang3.event.EventListenerSupport is used in order to fire when some class performs a certain operation and wants to inform all li

DDD - Concurrency with quantity

Hi everyone, I'm a little bit lost with a problem thinking in ddd way. Imagine you have an application to sell concert ticket. So you have an entity which is ca

Can modern x86 hardware not store a single byte to memory?

Speaking of the memory model of C++ for concurrency, Stroustrup's C++ Programming Language, 4th ed., sect. 41.2.1, says: ... (like most modern hardware) the

Parallel/Concurrent Method Execution in JavaScript

I am wanting to learn how to run functions in parallel/concurrently in JavaScript. Over the past few days I've read several pages about promises, async function

Multiprocessing OpenCV in Python

I have a simple Algorithm, I want to run it fast in parallel. The algo is. while stream: img = read_image() pre_process_img = pre_process(img) text

How to know which specific runnable has died in my threadPoolExecutor?

I am running a fixed amount of threads using newFixedThreadPool() and need to be able to know when one of the runnables has died, and know which specific run

How to break time.sleep() in a python concurrent.futures

I am playing around with concurrent.futures. Currently my future calls time.sleep(secs). It seems that Future.cancel() does less than I thought. If the futur

How is it possible for InnoDB to deadlock on a single row?

According to The Good Word, InnoDB uses automatic row-level locking. You can get deadlocks even in the case of transactions that just insert or delete a sin

SWIFT TASK CONTINUATION MISUSE: leaked its continuation - for delegate?

I'm trying to extend my class with async/await capabilities, but at run-time there is an error in the console: SWIFT TASK CONTINUATION MISUSE: query(_:) leaked