Questions tagged [locking]
Locking allows different types of resources to be locked by a transaction.
163
questions
2
votes
3
answers
94
views
Simple rwlock implementation in C
Can someone please review my rwlock implementation to see if there are any issues with correctness (hopefully not), give any feedback on how to write good C code etc, design patterns which could be ...
0
votes
0
answers
46
views
Synchronisation access to a shared class in Python server with async/await
Last week I wrote a simple server on FastApi to run ML model to classify a text on Chinese (split text on separate words). When I had clarified work of this model with API, it became time to confirm ...
4
votes
2
answers
921
views
Distributed lock system using AWS S3
I need a distributed lock system for a service I'm writing. (There can be multiple instances of this service running at a time, and I need to make sure that only one instance does a particular cron ...
1
vote
1
answer
323
views
Lock Guard Atomic alternative
I've recently written a Vulkan library for creating 2D applications with ease. The catch was I need std::lock_guard for my window resize event to resize resources ...
1
vote
1
answer
164
views
Dart Non-Reentrant Async Lock
This class synchronizes access to an async resource. If retainFutureErrors is false, it will keep retrying until there is a success. Otherwise, the ...
8
votes
3
answers
2k
views
Basic RAII spinlock class
I have written the following class that acts as a simple lock for mutual exclusion:
...
0
votes
1
answer
259
views
php flock with timeout (for LOCK_SH / LOCK_EX )
i want a flock with timeout, unfortunately i haven't found a good way to implement it (like a signaled timeout on an actual blocking request?), so i'm just trying and sleeping until success or timeout,...
2
votes
1
answer
186
views
C++20 simple RwSeqLock
I recently discovered the atomic wait/notify mechanism in C++20 and wrote this readers-writer lock in the style of Linux kernel Seqlock. Writes have to be inside a lock/unlock, while reads are ...
7
votes
1
answer
487
views
C++ mutex-like class using std::condition_variable
On a project I'm working on, I have a need for a mutual-exclusion primitive behaving like std::mutex or std::recursive_mutex, ...
2
votes
1
answer
189
views
Distributed lock service implementation in Golang
I have multiple E2E tests (written in Java) which share login details, each test during runtime will query the locker API for login details which is running on its own dedicated server.
Below is my ...
0
votes
1
answer
117
views
Data Wrapper Class with Automatic Saving and Locked Read/Write Accessors
This is a wrapper for a synchronized data structure that:
Saves periodically
Keeps track of dirty flag automatically (set when a write access is requested)
Maintains a lock on data
Only allows access ...
2
votes
1
answer
1k
views
C# lock on string value
Our codebase is full of locks such as:
lock("Something." + var)
{
....
}
This causes issues due to strings not meant to be used in locks in this way. ...
5
votes
3
answers
2k
views
Least Recently Used Cache with TTL
I found this problem in a book and found it interesting. wrote this class to implement a Least Recently Used Cache with TTL.
Goal -
LRU cache with TTL
Multithreaded.
Functions: Get(key), Put(key,...
15
votes
2
answers
2k
views
Block-free priority lock
Background
I wanted to write an event loop that supports scheduling, but found that no implementation of priority queue that I know of supports waiting on a condition variable (the idea is that the ...
0
votes
1
answer
845
views
Simple folder/file lock handler
I have two python scripts (or one bash script + one python script) which are working independently from another, one script puts data into a folder, the other one reads from it.
Since I don't want to ...