Skip to main content

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [locking]

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

Filter by
Sorted by
Tagged with
4 votes
1 answer
120 views

Maintaining a memory-barrier with an expression-bodied member

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
  • 141
0 votes
0 answers
39 views

ReadWrite Lock compatible with coroutines

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
170 views

Namespace-scope try_lock_for / try_lock_until pt. 2

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
148 views

Freestanding try_lock_for / try_lock_until

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
168 views

unique_multilock (unique_lock + scoped_lock) implementation

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
101 views

Simple async lock using key in .NET

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
393 views

Did I write the locks properly to prevent concurrency issues?

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
60 views

Distributed locking with fencing token implementation in Golang

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
135 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 ...
Tejas Anand's user avatar
4 votes
2 answers
1k 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 ...
threed's user avatar
  • 181
1 vote
1 answer
345 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 ...
FatalSleep's user avatar
2 votes
1 answer
196 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 ...
Christian Findlay's user avatar
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: ...
digito_evo's user avatar
0 votes
1 answer
322 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,...
hanshenrik's user avatar
2 votes
1 answer
231 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 ...
MDH's user avatar
  • 23

15 30 50 per page
1
2 3 4 5
12
Morty Proxy This is a proxified and sanitized view of the page, visit original site.