Skip to main content

Questions tagged [locking]

Locking allows different types of resources to be locked by a transaction.

4 votes
1 answer
187 views

I have a C# class with a number of properties that are read by and set by multiple threads. I use a simple lock when getting and setting them in order to have a full-fence memory barrier, so member ...
Joe's user avatar
  • 140
0 votes
0 answers
54 views

A while ago I wrote for my own needs a (non-reentrant) read-write lock for kotlin's coroutines. I got no reactions on the relevant github thread. I think it's a nice code, so I thought I'd share it ...
Al.G.'s user avatar
  • 109
2 votes
0 answers
184 views

This is my second iteration of implementing try_lock_for/try_lock_until function templates in which I've cherry-picked a bunch ...
Ted Lyngmo's user avatar
4 votes
1 answer
169 views

This is a breakout of a small part of unique_multilock (unique_lock + scoped_lock) implementation where it was suggested to put the logic in the member functions ...
Ted Lyngmo's user avatar
5 votes
2 answers
190 views

Inspired by How to implement unique_lock for multiple mutexes? I've implemented a RAII mutex locker with the combined capabilities of std::unique_lock and ...
Ted Lyngmo's user avatar
4 votes
1 answer
117 views

The task is to make a simple LockProvider that will lock a thread by identifier. Basic requirements: Simple call via using block. Support for CancelationToken to get out of waiting without exceptions....
sDima's user avatar
  • 889
4 votes
1 answer
422 views

There may be a dozen things that could be improved about this code, but it's just a very quick proof of concept and for the sake of this post I'm specifically wanting to know if someone can verify ...
BVernon's user avatar
  • 225
1 vote
1 answer
70 views

I was reading about the implementation of distributed locks where we need to verify the lease using a fencing token as per this article - https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-...
Pratyush Prateek's user avatar
2 votes
3 answers
158 views

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 ...
Tejas Anand's user avatar
4 votes
2 answers
1k views

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 ...
threed's user avatar
  • 181
1 vote
1 answer
364 views

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 ...
FatalSleep's user avatar
2 votes
1 answer
221 views

This class synchronizes access to an async resource. If retainFutureErrors is false, it will keep retrying until there is a success. Otherwise, the ...
Christian Findlay's user avatar
8 votes
3 answers
2k views

I have written the following class that acts as a simple lock for mutual exclusion: ...
digito_evo's user avatar
0 votes
1 answer
342 views

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,...
hanshenrik's user avatar
2 votes
1 answer
249 views

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 ...
MDH's user avatar
  • 23

15 30 50 per page
1
2 3 4 5
12