Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
247 views

We are extensively using Postgres advisory locks to re-centralize a distributed software system to publish to an API which requires aggregated data. Rarely, multiple locks have to be acquired which we ...
roookeee's user avatar
  • 1,878
Advice
1 vote
8 replies
146 views

I have several different jobs that can run throughout the day to read data from various sources and update my database. I want to ensure that two jobs are not trying to update the database at once. ...
John Gordon's user avatar
  • 33.8k
1 vote
1 answer
90 views

I am trying to do reindex concurrently on a table, but when I see pg_stat_activtity it shows in Lock state with Virtualxid as wait_event. It's tableA on which the reindex is being performed, but the ...
nmakb's user avatar
  • 1,325
1 vote
2 answers
426 views

[thread.mutex.requirements.mutex.general] p4 says For purposes of determining the existence of a data race, these behave as atomic operations ([intro.multithread]). The lock and unlock operations on ...
xmh0511's user avatar
  • 7,822
1 vote
1 answer
132 views

I've received a task to optimize our function for generating new partitions for a table. Let's say that we have something like this: CREATE OR REPLACE FUNCTION partition_creator(count_days integer, ...
denstran's user avatar
  • 394
2 votes
0 answers
155 views

We are using Windows 11 24H2 in our test system. There we start multiple instances of our GUI application (WinForms, .NET Framework 4.8) on each machine. The application is controlled via COM scripts ...
Sedenion's user avatar
  • 6,363
2 votes
0 answers
92 views

I am trying to learn some operating system engineering so I came about MIT's operating system engineering course which has been wonderful so far. The problem I'm having is with the second problem read-...
아이스크림은메로나's user avatar
0 votes
1 answer
153 views

I am trying to do a git fetch (or any other Git command) and I get the following error: fatal: Unable to create '/path/to/repo/.git/refs/remotes/origin/main.lock': File exists. There are no .lock ...
maria_so's user avatar
Advice
2 votes
6 replies
178 views

I have a function that updates the state of some shared resource. 99.999999999% of the time, this function is only called from a single thread. I want a cheap way for this thread to check for other ...
Loki Astari's user avatar
0 votes
1 answer
65 views

Why does the PostgreSQL run_maintenance_proc need pg_try_advisory_lock? Can I remove that? It keeps creating table deadlocks. Its probably because I am also using dbt to generate a few materialized ...
carfield's user avatar
  • 2,091
2 votes
1 answer
120 views

For some reason, this code doesn't work on Ubuntu 20, Python 3.8.10, unless the .gather line is commented out. It works on Ubuntu 24, Python 3.12.3 and Windows 11, Python 3.13.9. It doesn't work on ...
WorkerZ's user avatar
  • 23
Advice
1 vote
13 replies
6k views

I am trying to ensure that methods in my class can only be called by a single thread. So far tried to use ReaderWriterLockSlim to achieve this effect but this can cause potential issues if it is not ...
agracio's user avatar
  • 33
Advice
0 votes
1 replies
58 views

We’re building a system where an offer can be redeemed until a global limit is reached. For example, an offer may allow a maximum total redeemable amount (e.g., 10M), or/and only allow each user to ...
tusharRawat's user avatar
2 votes
1 answer
47 views

I am using RLockReactive from redisson to get the redis distributed lock, then performing a Supplier operation. The Supplier runs 2 steps in sequence, but I am seeing that while the lock is kept ...
Ashutosh Verma 's user avatar
6 votes
1 answer
407 views

Before I get to my main question, I'm assuming that std::mutex::unlock() stops touching this as soon as it puts the mutex in a state where another thread might lock it - even though the call to unlock(...
user3188445's user avatar
  • 5,186
0 votes
0 answers
84 views

I'm working on a Node.js project that reads data from an HFSQL database. I'm using the odbc library to create a simple connection like this: connection = await odbc.connect("DSN=xxxxx;UID=xxxxx;...
Gio's user avatar
  • 593
1 vote
1 answer
204 views

Consider this outline of a simple multi-threaded application. It has one writer thread, and ten reader threads. #include <atomic> #include <thread> const int Num_readers{...
WaltK's user avatar
  • 802
1 vote
1 answer
117 views

Code: pthread_rwlock_wrlock(&memlock); // (1) // do something... pthread_rwlock_rdlock(&memlock); // (2) // do something... pthread_rwlock_wrlock(&memlock); // (3) The following tags, (1),...
bod's user avatar
  • 33
3 votes
1 answer
143 views

I'm playing around with lockless C++ programming, and I came up with a method for safely(?) transferring ownership of a non-thread-safe data structure (std::unordered_map<int, float> in my ...
Jeremy Friesner's user avatar
1 vote
2 answers
194 views

I have created the following test scenario: CREATE TABLE master.mytest.control_table ( id int IDENTITY(1,1) NOT NULL, uuid varchar(36) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, status ...
Gabriel Souza's user avatar
2 votes
1 answer
89 views

Let's say I have a table CREATE TABLE mytable ( user_id bigint, someval text ) In my application, I want to lock and fetch every row for some given user_id e.g. 123 to do some additional ...
negimaster's user avatar
2 votes
0 answers
111 views

I have a piece of code, that checks if the redis db has data updates and loads them to the memory. I want only one corouitine to execute this load. class MyService: def __init__(self): ...
Artem Ilin's user avatar
3 votes
1 answer
2k views

I'm encountering a persistent issue where importing the sentence_transformers library on macOS causes my Python script to hang indefinitely. When the script hangs, the only output I see is a low-level ...
Akash Dubey's user avatar
0 votes
0 answers
56 views

I’m writing a prototype app for Android 11 (API 30, runs on MFP) that has to behave in the following manner: A background component that determines when a user has been inactive for N seconds. A ...
NKAT's user avatar
  • 191
0 votes
1 answer
81 views

I have a cluster of compute nodes, each node with many CPUs. I want them to execute commands located in a file, one command per line. The drive where the command file is located is mounted on all ...
Botond's user avatar
  • 2,852
1 vote
2 answers
119 views

I'm working on a hobby RISC-V OS kernel (QEMU virt) in no_std Rust and want my panic_handler to print the panic information to UART (is it the right way?). My println! macro eventually calls a _print ...
4rgon4ut's user avatar
0 votes
2 answers
163 views

Concurrent Access to Database Records in Quarkus I have a Quarkus application with two containers that are accessing the same database records on a schedule. The records have a field that is marked as ...
Kobra's user avatar
  • 1,378
0 votes
0 answers
71 views

I'm using a multi-node Galera Cluster and encountered the following two scenarios: Case 1 — Certification Conflict (Deadlock) occurs: Node B and Node C both start transactions. Both try to update the ...
samsamsamsmasma's user avatar
1 vote
0 answers
21 views

I am truncating a large table - a few Terrabytes in size. To ensure that there are no locking issues, I executed the following query in another window and the results are also there. Why isn't the ...
Jayadevan's user avatar
  • 1,434
2 votes
1 answer
208 views

In a Rails application using Postgres 16, I'm working on an automated process to detect indexes with high fragmentation, and reindex them whenever a certain threshold is reached. I'm not having any ...
Bustikiller's user avatar
  • 2,540
1 vote
3 answers
167 views

Call Mutex.lock() after if let. This lock will be held inside the whole if let block. If we lock again in the if let block. It's deadlock. This also happen for RwLock. use std::sync::Mutex; fn main() {...
Yanni Wang's user avatar
3 votes
1 answer
644 views

In Python 3.13 (haven't checked lower versions) there seem to be two locking mechanisms for the threading.Lock class. I've looked online but found no mentions of acquire_lock or release_lock and ...
leolion3's user avatar
1 vote
1 answer
100 views

I have two PostgreSQL tables: objects and metadata. Each object has a size property that represents its size in bytes and can be stored in a unique location with storage_id. In metadata, the ...
hyt's user avatar
  • 992
2 votes
1 answer
103 views

Code & Context I'm building a multithreaded program to automate API calls, to retrieve all the information I need based off of a list of unique IDs. To do this, I ended up creating my own Lock ...
Jacob Malland's user avatar
0 votes
0 answers
33 views

I am currently facing an issue related to locking an NFC tag after writing data to it. By "locking," I mean making the tag's data read-only, so that once the data is written, it cannot be ...
Developer Account's user avatar
0 votes
0 answers
40 views

Oracle 19c on Windows 2022. Is there a way to delete a .csv file that was locked by UTL_FILE() process that failed mid-way? I tried to rename it, LockHunter, UTL_FILE.CLOSE_ALL; , but all w/out ...
epipko's user avatar
  • 545
0 votes
1 answer
138 views

In Dynamodb paper 2022 https://www.usenix.org/system/files/atc23-idziorek.pdf, it's said that Transactions do not acquire locks. However in pseudo code in Listing 4 def processCommit ( CommitInput ...
Thế Hùng Phan's user avatar
2 votes
1 answer
319 views

Consider this example where I have 3 worker tasks that push results in a queue and a tasks that deals with the pushed data. async def worker1(queue: asyncio.Queue): while True: res = ...
Pablo's user avatar
  • 13.7k
2 votes
1 answer
166 views

I am writing a Kotlin/JVM Gradle plugin that stores data in an application-cache directory, so the data can be shared across separate projects. I need to ensure the contents are not modified while ...
aSemy's user avatar
  • 7,686
1 vote
0 answers
59 views

(I know that this question has come up several times on Stack Overflow already, but I still think it is worth clarifying some details.) Suppose that there are two independent Python processes: a.py ...
Richard's user avatar
  • 133
2 votes
1 answer
275 views

I'm trying to return a std::lock_guard by value. The following works fine using an online compiler (programiz), but in Visual Studio 2017 using C++17, lock1() below won't compile because I'm ...
H.v.M.'s user avatar
  • 1,746
2 votes
0 answers
89 views

I'm working with a fiber-optic reflective memory card (RFM2g model), which lacks atomic read-modify-write operations. My goal is to implement a spinlock across multiple processes (potentially running ...
MikuSoft's user avatar
2 votes
2 answers
106 views

If application has acquired row lock and is performing transaction, when shut down (eg. power outage) what will happen to the locked row? Is the lock turned off and whole transaction is rolled back?
Majki's user avatar
  • 33
6 votes
4 answers
238 views

I need to get a lock only during evaluation of the if statement condition. The lock must be released when running the code inside the if or else statements. I found a piece of code and I don't know if ...
Stefan's user avatar
  • 1,367
0 votes
1 answer
127 views

I am implementing pseudo-locking in an Access project. I have a table, tblLock which holds the lock records (includes the area being locked, the user, a timestamp). I could simply rely on this table ...
Phil Freihofner's user avatar
0 votes
1 answer
74 views

Improving Authentication Lock to Prevent Multiple Concurrent Requests I have a Node.js server that acts as a reverse proxy to my partner APIs. My mobile app makes 3 concurrent requests to my Node ...
Trey6's user avatar
  • 332
-3 votes
1 answer
116 views

I'm using unique_locks and normal lock to lead the threads. I try to interlink the threads, so they don't loose too many cycles and work together and not separately. I don't know, if my code can ...
user avatar
0 votes
1 answer
166 views

Postgres doc says: B-tree, GiST and SP-GiST indexes Short-term share/exclusive page-level locks are used for read/write access. Locks are released immediately after each index row is fetched or ...
xuhdev's user avatar
  • 9,654
0 votes
2 answers
88 views

If an application crashes (OOM / power failure / kill -9) after liquibase acquired a lock, but before releasing the lock, the lock will remain in the databasechangeloglock table forever and we'll need ...
Andrey's user avatar
  • 75
0 votes
2 answers
140 views

I have problem with following code. I started new thread which have empty while loop. It causes that function psutil.net_connections() is executed slowly. I need to wait about 1 minute to get result. ...
mztulip's user avatar

1
2 3 4 5
179