The locking tag has no wiki summary.
1
vote
1answer
47 views
ReentrantLock with priorities for waiting threads
I am trying to have a ReentrantLock with another way to determinate which thread will have the lock in the waiting queue. ReentrantLock implementation manages a Fair/Unfair policy, that's not what I ...
4
votes
2answers
123 views
Did I need to use lock to ensure that Queue.Dequeue is Thread Safe in this case on .NET 2.0?
Is this ok? I am using C# and .NET 2.0
I have this Queue declared in my class :
static private Queue<SignerDocument> QUEUE = new Queue<SignerDocument>();
I fill this Queue with some ...
1
vote
1answer
96 views
Read-write lock implementation for Ruby, new version
I recently discovered that there is no free read-write lock implementation for Ruby available on the Internet, so I built one myself. The intention is to keep it posted on GitHub indefinitely for the ...
9
votes
2answers
188 views
Lock-free cache oblivious n-body algorithm
I'm currently looking at, from a rather high level, the parallelization of the gravity calculation in an N-body simulation for approximating a solution to the N-body problem.
The simple form of the ...
3
votes
0answers
294 views
“Fast” Read/Write Lock
I need a Read-Write lock that is fast and generally portable on Windows machines (including XP, otherwise I'd just use the SRWLock that was introduced with Vista). I've written this custom ...
2
votes
1answer
176 views
Single word CAS tagged pointer for algorithms susceptible to the ABA problem
I've been looking for a solution to the ABA problem for a lock-free stack. Searching the Web revealed patented and complicated hazard pointers and tagged pointers using double compare-and-swap (DCAS, ...
0
votes
1answer
73 views
Security concerns with locking files
I'm writing a perl script which reads logs from a file and looks for matches from another file before sending the matches off by email. The problem is, I'm dealing with files which could be changed (a ...
4
votes
2answers
1k views
Using Timer with Backgroundworker to ensure the doWork method is called
I have a windows forms application in which a backgroundworker is called again and again.
I need to avoid concurrent access of the code in dowork method for the backgroundWorker; but also need to ...
5
votes
2answers
353 views
Associating a lock/mutex with the data it protects
I've recently come across some areas of code in our solution that have a few thread-safety problems. Thread-safety is a minefield at best so I thought I'd have an attempt at writing a few little ...
5
votes
0answers
371 views
Waiting for a lock to release with ManualResetEvent and Quartz
Follow-up to: Waiting for a lock to release with Thread.Sleep()?
I've found the time I tried to rewrite my WaitForLock-Method to utilize the Quartz.NET Scheduler which I've been using for some ...
7
votes
3answers
679 views
Waiting for a lock to release with Thread.Sleep()?
There's a follow-up: Waiting for a lock to release with ManualResetEvent and Quartz.
I've written a simple Lock-Mechanism which is saving the states of the locks in a database. Now I need to wait ...
3
votes
0answers
847 views
C++ critical section with timeout
NOTE: My implementation is based on codeproject article by Vladislav Gelfer.
Based on valdok's codes, I rewrote the critical section class. The difference is that my implementation integrated ...
2
votes
2answers
331 views
Composable Locks using LINQ. Can anyone see any problem with this ?
I was playing around with LINQ and I came up with the following idea for composing locks taking advantage of C# Monadic syntax. It seems too simple, so I thought let me post it on StackExchange and ...
4
votes
1answer
204 views
Is this waiting code with timeout ok?
public boolean connectedOnGameServer = false;
public final Object conGameServerMonitor = new Object();
public void connectedToGameServer() {
synchronized (conGameServerMonitor) {
...
20
votes
5answers
2k views
Is this (Lock-Free) Queue Implementation Thread-Safe?
I was trying to create a lock-free queue implementation in Java, mainly for personal learning. The queue should be a general one, allowing any number of readers and/or writers concurrently.
Would you ...