Questions tagged [readwritelock]

ReadWriteLock is a structure of the two locks. From these, one locks for reading (multiple threads can access, none can modify) and another for write access (only one thread can access and also modify at time).

In Java, ReadWriteLock is a very abstract interface which provides functionality to synchronize between multiple readers and one exclusive writer.

It just assumes some structure that contains two locks. Serious problems with this interface are unlikely. If you ask something about it, probably you mean ReentrantReadWriteLock, the implementation.

Related tags:

96 questions
0
votes
2 answers

Java ReentrantReadWriteLock requests

Just a quick question about ReadWriteLocks in Java (specifically the ReentrantReadWriteLock implementation) as I don’t find the sun documentation clear. What happens if a read lock is held by a thread when a write lock is requested by another? Does…
Lehane
  • 47,588
  • 14
  • 53
  • 53
0
votes
2 answers

Is read-write lock needed for this use-case

My question is similar to this thread, however I am sure if the conclusion drawn in the given thread applies here. My use case: In the application, there is a status thread which sends out the same texual information after every 1 second. Texual…
Amey Jah
  • 913
  • 3
  • 11
  • 24
-1
votes
1 answer

Boost multithreading exception

I have a program like main.cpp #include #include #include class MutexClass { private: /* data */ boost::shared_mutex m_mutex; bool running; //The flag program should…
-1
votes
1 answer

Java file lock for read and write with multiple processes

In my application multiple processes are trying access a file for read and write. Every application has a single thread. I need to make sure that no 2 processes are accessing the file at the same time. I am using FileLock in JDK. This works fine,…
Bagira
  • 2,149
  • 4
  • 26
  • 55
-1
votes
1 answer

Problem in implementing multiple threading for operations on a linked list

In the following code, I tried handling various linked list operations using multiple threads. Multiple linked lists can be supported and all functions are generic except I kept a few printf statements to debug the code. typedef void…
user12908778
-3
votes
2 answers

Simple Read Write Lock

I find many read write Spin lock implementation over the internet are unnecessarily complex. I have written a simple read-write lock in c++. Could anybody tell me , if I am missing anything? int r = 0; int w = 0; read_lock(void) { …
tekkk
  • 324
  • 2
  • 8
1 2 3 4 5 6
7