Questions tagged [readerwriterlock]
71 questions
0
votes
0 answers
Does Java 8 provide Locking Priority?
I have one writer object and multiple reader objects.
They read/write to single object "StateObject"
Reader:
ReadLock
Read StateObject
ReadUnlock
Writer:
WriteLock
Update StateObject
WriteLock
Assume that currently 5 outof 10 readers holding…
user3851499
0
votes
0 answers
Consecutive read/write threads synchronization in Python
I'm trying to implement the Reader/Writer lock mechanism to control the synchronization of 3 threads each of which is executed 4 times based on random draw of dice. For example, for thread i, random.randint(1, 6) is called and if the output is even,…

7kemZmani
- 658
- 1
- 8
- 21
0
votes
1 answer
use ReaderWriterLock in c# xaml
I want to use ReaderWriterLock in this function:
static async void ETDGazeDataEvent(ETMWNet.ETGazeDataType pGazeData)
{
StorageFolder ETfolder = ApplicationData.Current.LocalFolder;
StorageFile file = await…

Ori Lomnitz
- 1
- 1
- 2
0
votes
1 answer
C# ReaderWriter lock thread release priority
I've recently bumped into multithreading perfomance issue, and started to investigate how to optimize current code.
The most suitable solution for my issue is using readerwriter lock, but this article of Jeffrey Richter made me have some doubt in…

Johnny_D
- 4,592
- 3
- 33
- 63
0
votes
0 answers
ReaderWriter Lock, My code just gives exceptions
I'm trying to implement the Reader Writer Problem .. I don't know what is wrong with it?
can any one help me figure out why?
...................................................
package readerWriterController;
import java.util.ArrayList;
import…

YaoMing
- 1
- 1
0
votes
1 answer
ReaderWriter Lock-free implementation
I want to implement a simple multi-reader/single-writer lock using a volatile value.
Although _InterlockedXXX provides full fence barrier and, if i'm right, also "volatile" keyword, I want to know about possible defects and improvements. I have no…

Mauro H. Leggieri
- 1,084
- 11
- 25
0
votes
1 answer
Reader-writer lock with condition variable
I find neither boost nor tbb library's condition variable has the interface of working with reader-writer lock (ie. shared mutex in boost). condition_variable::wait() only accepts mutex lock. But I think it's quite reasonable to have it work with…

user2100910
- 327
- 3
- 12
0
votes
1 answer
Multiple-readers, single-writer synchronization lock between processes on Windows with WinAPI/C++
There's a well-known algorithm that employs readers/writer lock synchronization between threads of a single process on a Windows platform using pure WinAPIs/C++:
Here's an example
In my case I need to do this between several processes, i.e. the…

ahmd0
- 16,633
- 33
- 137
- 233
-1
votes
1 answer
ReaderWriterLock blocks when trying to read resource
I am trying to use a ReaderWriterLock for a shared resource between two Tasks.For some reason it starts waiting indefinitely:
class State {
private const int TIMEOUT = 5000;
private ReaderWriterLock lck = new ReaderWriterLock();
…

Bercovici Adrian
- 8,794
- 17
- 73
- 152
-1
votes
1 answer
What's wrong with this first readers-writers solution implementation in C using mutex?
I am trying to implement the first readers writers problem (reader's preference) in C. I am using mutex locks and unlocks to make sure that no writer can access the thread if a reader has a lock and any reader can access the thread if the first…

theprogrammer
- 1,698
- 7
- 28
- 48
-2
votes
2 answers
How to prempt all reader as 1 writer comes in reader writer locks?
Above is reader write problem solution where writer has preference over reader.
Suppose, initially 1000 readers start executing code to read data (suppose reading data code is huge and takes 1 sec for each thread) then 1 writer tries to write data.…

Suri
- 3,287
- 9
- 45
- 75