Questions tagged [locks]
A lock generally refers to something that prevents another process from starting or accessing the same information until the lock is released. Use with an appropriate language tag. Do not use for physical locks.
locks
445
questions
0
votes
1
answer
18
views
how reentrant locks ensures mutual exclusion?
I am confused about the reentrant lock and mutual exclusion if a thread can reacquire lock multiple times doesn't it violet mutual exclusion because other thread also wants to acquire the lock?
i know ...
0
votes
0
answers
40
views
Does executing a Lua script in Redis block the entire Redis server or just the database being accessed?
Details:
Atomic Operations: I understand that Lua scripts in Redis are executed atomically. However, I need clarification on whether the atomicity affects only the Redis database being accessed by the ...
0
votes
1
answer
62
views
postgresql NESTED transactions with LOCKS
i have a modular event driven monolith application written with nestJs i have module A, B and C.
Module A will emit an event, both module B and C will listen to that event, they will both share the ...
1
vote
0
answers
25
views
Redis lock is stuck on acquiring
I'm trying to perform a sanity check on Redis Locks (async version):
import redis.asyncio as redis
import tqdm
import asyncio
r = redis.Redis(decode_responses=True)
async def update():
lock = r....
0
votes
0
answers
43
views
Using UPDLOCK and HOLDLOCK to prevent duplicate data from being inserted
I have a service method (C#) that retrieves data from an Azure SQL Server database, processes it, and then performs some inserts. When this method is called from different processes, for a large ...
0
votes
0
answers
65
views
What is the correct way of obtaining LWLocks in postgres?
As per the postgresql source code, there are two ways of obtaining LWLocks.
One way :
extern void RequestNamedLWLockTranche(const char *tranche_name, int num_lwlocks);
extern LWLockPadded *...
0
votes
0
answers
47
views
Transaction Performance Analysis Overview report compared to a script for lock statistics
In SQL server for a specific database I used the standard reports to gather table analysis from the transaction performance analysis overview report. Which gave me the lock statistics.
Some of the ...
0
votes
0
answers
47
views
Gap locks using InnoDB
I am facing deadlock issues which I suspect is from gap lock that is issued when my select for update doesn't find a row
Hi everyone.
Currently I am facing a deadlock issue between two inserts into my ...
0
votes
0
answers
46
views
Spring JPA Concurrency Transactional or Lock
As per ACID properties, @Transactional should handle Isolation by default. For Isolation.REPEATABLE_READ, it should prevent dirty read, non repeatable read problems. I'm using MySQL database, Spring ...
2
votes
0
answers
72
views
How to correctly set the lock in MySQL?
There are two tables: site (id, name, url), page (id, code, content, path, site_id). The site table has a record with id = 1. The page table is empty.
I'm trying to insert a new record into the Page ...
0
votes
0
answers
85
views
Using JdbcLockRegistry from different threads to lock and unlock based on lockKey
We are using the Temporal framework to run several workflows. Due to the design of the application I cannot return Lock instance to the main method which starts all the workflows and hence I am ...
0
votes
0
answers
36
views
Thread counter Synchronization issue
I am trying to learn Multithreading techniques.
I tried to implement the synchronized behaviour to increment the counter.
I am using two variables one is AtomicInteger and another one with normal ...
0
votes
1
answer
62
views
Using custom locks to insert rows safely
I basically need an UPSERT functionality where a row is created once a day and updated from then on until the next day. From a business perspective, there must be one or zero rows per day.
My problem ...
0
votes
0
answers
88
views
Distributed Locking service in AWS
We have a couple of Microservices deployed using EKS in AWS.
For these various services or multiple instances of these services, we need to implement a distributed lock.
What are the best options to ...
1
vote
1
answer
130
views
Allow concurrent executions of two methods but not both at the same time
I have two instance methods method1 and method2 of an singleton object. method1 can be run concurrently by separate threads. Meaning we can have 5 threads each running method1 at the same time or 1 ...