python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Get distinct sets of rows for an INSERT executed in concurrent transactions
I am implementing a simple pessimistic locking mechanism using Postgres as a medium. The goal is that multiple instances of an application can simultaneously acquire locks on distinct sets of users.
T...
Gregor Schröder
Votes: 0
Answers: 1
Why SpinLock doesn't support recursion
I wonder why SpinLock doesn't support recursion.
Let's say I have a simple program with Monitor that locks and releases a block of instructions in a recursive way:
class Program
{
private static r...

Qwertyluk
Votes: 0
Answers: 0
Synchronization when accessing two ends of a queue from different threads
I have one thread t1 which writes some data into a queue in the following manner:
while True:
// generate data
lock (myQueue)
{
myQueue.Enqueue(data);
}
I have my main thread...

user8352734
Votes: 0
Answers: 1
RAII locking with condition
I have a piece of code which needs to be protected by a lock only if some condition is true.
if(condition) {
std::lock_guard<std::mutex> guard(some_mutex);
// do a bunch of things
} els...
0Nicholas
Votes: 0
Answers: 1