Questions tagged [multithreading]
Use this tag when the program performs its work using multiple concurrent threads of execution.
1,625 questions
4
votes
1
answer
166
views
API having flow - normal flow along with background poller(it also involves events which is not shown here)
We have an API in which we call external service with a tracking id.This first part of the API workflow makes an entry to the DB as SUBMITTED after the call to first external API say /E1 finishes and ...
0
votes
0
answers
40
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 ...
10
votes
3
answers
1k
views
C++17: shared_mutex protected DNS cache (rare writes, many reads) return-by-value vs decltype(auto)?
I’d appreciate a review of this small DNS cache.
It stores pairs of domain and IP address
and uses a std::shared_mutex because reads are frequent and writes are ...
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 ...
4
votes
1
answer
149
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 ...
4
votes
3
answers
678
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 ...
5
votes
2
answers
169
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 ...
7
votes
3
answers
1k
views
Rotary Encoder Controller C++
I built a controller with 3 rotary encoders to control various parameters of a program i wrote to control a motor. The controller delivers data via usb through serial (Arduino).
Originally I used OSC ...
1
vote
0
answers
76
views
A parallel MSD radix sort in Java for long keys with near linear speedup
Intro
I have this implementation of a parallel MSD (most significant digit) radix sort. It runs in
$$\mathcal{O}\Bigg( \bigg(\frac{N}{P} + PB \bigg) \log_B \sigma\Bigg),$$ where \$N\$ is the length of ...
8
votes
2
answers
1k
views
C# wait for a state change without blocking
I have a class that manages an HttpClient to make API requests to a third party service. The service requires being logged in to make requests. When logged in, a ...
6
votes
2
answers
876
views
ParallelSudokuSolver.java: solving semi-large Sudokus via multi-threading
Intro
This time, I have programmed a parallel sudoku solver in Java.
Code
io.github.coderodde.sudoku.ParallelSudokuSolver.java:
...
0
votes
2
answers
118
views
Small library for metrics scraping in C++
I did an internship test project (source: https://github.com/SynI20N/VKInfo). Looking for some middle or senior devs to rate it and point out potential problems with my code.
Follow up: How would you ...
2
votes
0
answers
34
views
GUI button clicks start runspaces that take care of heavy processing tasks
I'm currently updating a ping script I maintain at work, transitioning from WinForms to WPF. Because of this I've started learning about and incorporating runspaces to keep the GUI responsive during ...
4
votes
1
answer
103
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....
3
votes
1
answer
78
views
More shortest unrestricted paths to touch every square in an n by n grid
This is a part two.
The problem originates from here,
it is solved for \$n<11\$. A GitHub repository for this code, printing paths, and a collection of all proven best paths, it is open to ...