All Questions
Tagged with synchronization or thread-safety
524 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
27
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 ...
4
votes
3
answers
658
views
Multithreaded array summation in Java - best practice, structure, acceptable use of Constant classes. There is no concurrency?
The task is educational. The basic functionality is working. Here are some questions for my code. Please give me feedback.
Main:
Architecture & Design: Is the decomposition appropriate? Should ...
7
votes
1
answer
288
views
Implement a "split" synchronization barrier for C++ with OpenMP
EDIT TL;DR Anyone who might consider using my code below in production and can afford to require C++-20 standard should rather use std::barrier as suggested by G. ...
7
votes
2
answers
424
views
High performance Thread-safe FIFO accumulator
I am writing some C# code. I want to find a data structure that can implement the following strategy:
FIFO data access mode
Multiple independent threads add elements to the data structure
At a random ...
9
votes
2
answers
852
views
Thread safe cache to sql call in c#
I'm unsure whether the following is thread safe. I want to say it is because the static state is only assigned to within the lock. However I'm more of a js programmer so this is out of my comfort ...
8
votes
3
answers
1k
views
Thread-safe payment registration emulation practice
I wrote this small service which emulates a payment registration system.
My main concern is thread-safety in general, and the caller shouldn't be able to register a payment while one is already in ...
2
votes
1
answer
60
views
Synchronizing an embedded system with RTOS
I wrote this code for a make-up assignment to pass one of my college class and graduate from my program in the field of electronic and embedded system.
It's pretty much the realization of a solar ...
6
votes
3
answers
697
views
Ring Buffer Implementation in C++
The following code is designed for handling real-time messages. It assumes there will be only two threads using the RingBuffer object:
A provider thread calls the <...
3
votes
1
answer
66
views
Not so Simple Thread Pool (part 2)
Previous version of my ThreadPool is here
This one is improved and updated using advices:
added variables list (vector) to not use std::any. it's very basic and simple.
added thread-safe queue
!main....
3
votes
1
answer
63
views
Simple ThreadPool
ThreadPool, Task
I continue to study C++ for the fourth month, every day from morning to night. Today I want to submit my Thread Pool for review. I'm not really sure if I have the right code style, ...
2
votes
1
answer
94
views
Take photographs using simulated cameras that share a lock
I'm new to threading in Python. I want to use it to speed up taking images on my lab computer. I have the following dummy code:
...
4
votes
1
answer
273
views
Logging in a different thread using circular buffer C++
What it does
The code creates a logger class which instantiates a circular buffer at construction and uses producer-consumer style approach using condition_variable to log and print the messages to ...
4
votes
1
answer
541
views
Lazily decode a buffer with a thread-safe Iterator
I have implemented an Iterator for my Pojo class.
The purpose here is to lazily decode multiple ...
2
votes
2
answers
190
views
Wrapping SemaphoreSlim.WaitAsync with an IDisposable
The usual way of dealing with a SemaphoreSlim is
...
1
vote
1
answer
188
views
SynchronizedObservableCollection: a thread-safe ObservableCollection
After reading many people talk about the need for a SynchronizedObservableCollection and their implementations I decided to roll my own. I wanted to add a ...