All Questions
Tagged with concurrency locking
845
questions
-1
votes
1
answer
52
views
GO Cond - fmt.Println after wg.Done ended up dead lock
Unable to understand this dead lock situation in golang, i have below to go code with pub and sub pattern
package main
import (
"fmt"
"sync"
)
func main() {
cond := ...
1
vote
2
answers
72
views
Java readwrite concurrency: readwrite lock vs lock + volatile
Assuming that readers = 10 x writers, which of the following solutions is better in terms of throughput. Which solution is better to use in production code?
Using single lock for set operation and ...
0
votes
0
answers
54
views
Lock the external API call for same values
Scenario:
I have a microservice that provides IP address information for other part of the system to use. This microservice uses an external API to get this info and each response will be saved on ...
0
votes
1
answer
53
views
Lock behavior on mass delete queries with postgresql
I would like to know how Postgresql handles locks on bulk deletions.
My goal is to avoid deadlocks during my opertations.
At the moment, we only do insertions and updates (using batched INSERT ON ...
0
votes
0
answers
19
views
Two Update statements on a row are running simultaneously with no locking in MYSQL
I relied on row locking in mysql to prevent simultaneous running of one php script when working on one userid.
I used following
UPDATE users SET rowlock = 1 WHERE id = ? AND rowlock = 0
and then in ...
0
votes
0
answers
13
views
How to implement read and write locking for a MongoDB collection?
I'm developing a match-making system for a game where each match involves two players.
waiting-users-queue collection:
user_id (String)
status (String)
Here's the logic I'm trying to implement:
When ...
0
votes
1
answer
29
views
Update a record or insert if it doesn't exists, with locking
I would like to update a record if exists. Thats the easiest part, but that record may not exist, so let's create it first. Pseudocode:
UPDATE x SET y=1 WHERE id=5
if the result of it is 0, then...
a,...
1
vote
0
answers
62
views
Optimizing file locking for 1000+ concurrent NFS users: What is the best practice?
I'm developing a Bash script for a project involving NFS (specifically NFS3 and NFS4), aimed at managing critical sections. The script must efficiently handle over a thousand concurrent processes ...
1
vote
1
answer
101
views
Seeking Patterns to Address Concurrent Update Challenges in a Domain-Driven Design Context
Our development team is currently exploring effective patterns to handle situations where concurrent updates might lead to data inconsistencies. We adhere to Domain-Driven Design (DDD) principles, ...
0
votes
2
answers
96
views
Preventing concurrent executions of a java method based on a key
I'm working on a java application that needs to submit post requests to an external API. The problem I'm running into is that if the event that executes the method is trigger more than once (such as ...
-1
votes
1
answer
309
views
Using sp_getapplock on MS SQL Server to prevent multiple instances of an application running concurrently
Consider an application which is designed in such a way that horizontal scaling is not supported. Basically, if 2 or more instances of the application run at the same time bad things happen (e.g.: the ...
0
votes
1
answer
111
views
ConcurrentModificationException on a object wrapped with lock [duplicate]
I've left my application up for a night and noticed such a stacktrace in the morning:
java.util.ConcurrentModificationException: null
at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(...
0
votes
2
answers
488
views
`select for update` does not return updated row when another process updated a foreign key in that row and select joins two tables
According to the PSQL docs on explicit locking:
SELECT FOR UPDATE will wait for a concurrent transaction that has run any of those commands on the same row, and will then lock and return the updated ...
0
votes
2
answers
117
views
What is the actual usecase of trylock in java
What is the actual usecase of trylock in java.
If I check trylock in if block and write an else block, I will end up loosing actual business logic which is there in if block and thread will never hit ...
0
votes
1
answer
308
views
Handling Concurrent Product Orders and Quantity Updates Safely in NestJS
I'm currently facing a challenge in my NestJS application related to managing concurrent product orders and quantity updates. Below is a simplified version of the code I'm using to create orders:
...