Skip to main content

Questions tagged [locks]

Locks are a synchronization mechanism for enforcing limits on access to a resource.

1 vote
4 answers
273 views

Context I'm working on a client-server-agent application, where server distributes tasks supplied by clients over agents. Server is passive, all communications are initiated by clients and agents. ...
Basilevs's user avatar
  • 4,507
1 vote
1 answer
345 views

I'm thinking about implementing garbage collection efficiently by protecting the structure that tracks allocations using reader-writer lock. However, I'm worried memory semantic may invalidate the ...
DannyNiu's user avatar
  • 374
1 vote
2 answers
356 views

Over and over I am faced with a similar problem: I have to perform two actions that are mostly unrelated, except that they need to share a mutex lock, at least for a moment. For example: void action() ...
CygnusX1's user avatar
  • 257
5 votes
2 answers
2k views

Recently I've come to discover that I've inherited one of the internal auxilliary programs used. I've made a few minor fixes and features to improve it in the past, but now I've been given a major ...
rdi_pck's user avatar
  • 61
-1 votes
1 answer
416 views

Edit #1 I believe that I misrepresented my intent when writing this question by focusing too much on the issues that have arisen from our misuse/misunderstanding of locks. I am making this edit to try ...
notphilphil's user avatar
4 votes
4 answers
4k views

I'm an experienced Software Engineer but very weak in concurrency because of no prior experience in that. I've been interviewing with several companies in which I was asked similar kind of questions ...
SherlockHolmesKePapa's user avatar
-1 votes
1 answer
2k views

I'm working on a web application using Spring (Java and JPA + Hibernate) and I was wondering if there is a way of locking a MYSQL table and then when another web service (or even another thread from ...
Jordi Pagès's user avatar
2 votes
0 answers
315 views

Since I am working in a multi-instance microservice environment, I came accross a problem with making some operations being performed at most by one of the running instances at once. The solution ...
PJDev's user avatar
  • 129
1 vote
2 answers
319 views

Problem In my application a user can lock a set of related aggregate roots to work exclusively on them and to avoid the usage of an invalid set of objects later in the process (by other employees). ...
deamon's user avatar
  • 886
1 vote
2 answers
1k views

I am calling a payments API to send a payment. At the same time, I need to mark the payment as sent in my database. If I call the API first, then the database crashes, the payment will be sent twice. ...
Lucien's user avatar
  • 121
1 vote
2 answers
357 views

A simplified version of my problem looks like this: the database contains two tables: one contains account balances (Accounts) the other contains account withdrawal and deposit requests (Requests) ...
Alexey's user avatar
  • 277
7 votes
3 answers
739 views

We have a REST API Get request which downloads a file from the server. This file needs to be updated whenever there is a latest version. Currently this is done by deleting the existing file and moving ...
Anjo's user avatar
  • 215
7 votes
5 answers
9k views

in read-write locks, why do we need read locks since processes can read a file at the same time? Would only a write lock suffice? Thanks.
Tim's user avatar
  • 5,565
0 votes
2 answers
376 views

this is a highly theoretical question about my parallelization approach. First of all, I want to inform everybody that I do not claim that I am the 'inventor' of that approach but I couldn't find any ...
Damian Grzanka's user avatar
-3 votes
1 answer
91 views

A program I'm developing has two threads running similar but different task: thread1: timer1.start() writeToExternalDB1(consumedData) timer1.end() thread2: timer2.start() writeToExternalDB2(...
zonyang's user avatar
  • 103

15 30 50 per page
1
2 3 4 5 6