Skip to main content

Questions tagged [multithreading]

Use this tag when the program performs its work using multiple concurrent threads of execution.

172 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
16 votes
0 answers
3k views

Realtime concurrent Haskell MIDI buffer

Problem Background MIDI is a serial representation of control signals to a sound generator. Typically, a noteOn message initiates the attack phase of a sound at a given pitch. The note will ...
user1441998's user avatar
15 votes
0 answers
248 views

Download files in parallel

This module has a ensure_downloaded function which takes a slice of Urls. It downloads all of the urls to a local downloads ...
Winston Ewert's user avatar
10 votes
0 answers
727 views

Sieve32FastV2 - A fast parallel Sieve of Eratosthenes

I’ve created a much cleaner, better designed version to my parallel sieve. I’ve implemented most of EBrown’s micro-optimizations but also revamped the code on my own (that is not in direct response ...
Rick Davin's user avatar
  • 6,360
8 votes
0 answers
404 views

Implementing GSL synchronized_value

Core Guidelines mention a type synchronized_value<T>, which supposedly pairs std::mutex with the internal value. I couldn'...
Sergey Kolesnik's user avatar
6 votes
0 answers
9k views

Example of multithreading in Python3 / PyQt5 using QThread

I wanted to make a simple example of multithreading with QThread in PyQt5 / Python3. The script generates a set of QLineEdits and buttons to start and stop a set of ...
SDiv's user avatar
  • 161
5 votes
0 answers
694 views

Multithreaded pathfinding in Unity C#

I've tried to implement multithreaded pathfinding in an attempt to increase performance, but if anything, performance seems to actually decrease when I enable multithreading. Is there anything I ...
xcrypt's user avatar
  • 151
5 votes
0 answers
188 views

stable producer/consumer threads in python

I have implemented a producer/consumer functionality using threads in a given framework and I'm pretty sure I did not cover all possible scenarios. I made a small reproducible version. Lines ending ...
Duda's user avatar
  • 151
5 votes
0 answers
706 views

Liveness monitor : python and RabbitMQ together through Pika

I'm a beginner using Python, and I'm trying to implement a functionality of a monitor program already developed by an other programmer. This program is working on a Windows machine (made by Inno ...
Hooli's user avatar
  • 181
5 votes
0 answers
60 views

Lightweight lock using OMP atomic

I am working on a Monte Carlo simulation using OpenMP multithreading. To avoid race conditions when multiple threads work on the same resolution element, I have implemented the following ...
user35915's user avatar
  • 151
5 votes
0 answers
168 views

A Parallel Processing Template for Divide & Conquer Problems

I’ve written a program for solving a problem using standard single-threaded code. However, it looks like it could be recast as a multi-threaded problem using divide & conquer. Since this is a ...
davypough's user avatar
  • 405
5 votes
0 answers
921 views

Uploading captured video to Google Cloud Storage

My program intends to capture video streams (in mjpeg) with OpenCV and upload the captured frames into Google Cloud Storage for later processing. I am expecting to capture ~15-20 frames per second and ...
Rex Low's user avatar
  • 151
5 votes
0 answers
4k views

Auto clicker with a simple GUI

What do you think of my auto clicker script? Even though it's just for my own personal use, I'm thinking of using PyInstaller to turn it into an exe, so I know how to do that in the future. ...
ant9985's user avatar
  • 51
5 votes
0 answers
165 views

Delegated condition_variable against spurious wakeup

This is my attempt at dealing with spurious wakeups: A new class which replaced std::condition_variable in my code. Some questions which came to my mind are (and I ...
PhilLab's user avatar
  • 193
5 votes
0 answers
149 views

Simple HTTP router package

I have created a router/micro-framework. I have split my code into multiple files by responsibility. All files are in the same directory. Would you recommend any way of improving it ? The most ...
vardius's user avatar
  • 151
5 votes
0 answers
162 views

Multiple rusty Sieves of Eratosthenes

To get more familiar with the multi-threading aspects in the Rust language I decided to multi-thread my earlier implementation of The rusty Sieve of Eratosthenes. I have to say that it is probably in ...
skiwi's user avatar
  • 10.6k
5 votes
0 answers
210 views

Text-based Snake game on Window - follow-up

Previous question: Text-based Snake game on Window Summary of improvements: Removed unnecessary functions such as clearScreen() Added new ...
MORTAL's user avatar
  • 3,278
4 votes
1 answer
322 views

Monitoring and re-establishing a PostgreSQL connection

Within a complicated Ruby project, I need to monitor the connection to a PostgreSQL database, as answered here. I use a thread for this purpose. Every few milliseconds, I invoke "consume_input" which ...
Otheus's user avatar
  • 141
4 votes
0 answers
2k views

Android APP connect to FTP server in Java

I am attempting to build an Android APP with the ability to connect specified FTP server in Java. The connection operation has been performed in FTPconnection class ...
JimmyHu's user avatar
  • 5,360
4 votes
0 answers
1k views

PyQt load images in background process

I am building an application that needs to load 100-200 images (really only limited by performance) and display them to the user in a sort of gallery. A good analogy would simply be Google Images. In ...
Spencer's user avatar
  • 261
4 votes
0 answers
125 views

Sending simultaneous requests using threading

I have been trying to improve my Discord sending webhooks functions where I have multiple dictionaries, as you will see in the code below: ...
PythonNewbie's user avatar
4 votes
0 answers
156 views

Just a digital clock in Swing

I've written a little clock implementation in Java Swing. It now seems to work flawlessly after having terrible Swing specific timing problems. Please indicate if this is the way to draw the clock and ...
Maarten Bodewes's user avatar
4 votes
0 answers
231 views

Game of Life, thread per cell

In an effort to learn Java's support for concurrency I solved a self-imposed exercise to write a Game of Life simulator in Java, running a separate thread for each cell. Here is my code: ...
gaazkam's user avatar
  • 561
4 votes
0 answers
152 views

Running DNS lookup over million IP addresses

I need to run over all the IP addresses on the CIDR 10.96.0.0/12 network. There are 1,048,574 IP addresses. I created a multi ...
E235's user avatar
  • 237
4 votes
0 answers
383 views

Java multithreading many readers one writer implementations

I have a shared data object with writer threads and reader threads. Number of threads can read from the shared data at the same time (in the code getmethod), and ...
user avatar
4 votes
0 answers
700 views

Parallel solutions to N Queens Puzzle

I'm trying to increase the performance of my N Queens Puzzle solution. I'd find some threads on SO already but they don't appear to help me to increase performance. My best solution, however, is a ...
Noixes's user avatar
  • 141
4 votes
0 answers
126 views

C++11 Removable connection from emitter or receiver object

Please review my solution for the following problem. I am interested in: Maintainability Usability Logical correctness Efficiency Problem: It has 1+ objects each in separated thread and between the ...
István Simon's user avatar
4 votes
0 answers
1k views

Python port scanner using multithreading

I have written a rather simple port scanner using python and I would like to know things I could do better regarding: Code quality, making the code in general better Performance, making the code run ...
404response's user avatar
4 votes
0 answers
433 views

Custom ThreadPoolExecutor/ThreadFactory in order to submiting callables upon incoming ActiveMQ messages

I have a service that is subscribed to a specific channel of ActiveMQ. Every time a message arrives the service has to start a "job" (submit instances of Callables)...
Luca Sepe's user avatar
  • 141
4 votes
0 answers
3k views

Capture, display, and save webcam video with openCV using C++

The basics were taken from one of the more basic OpenCV examples. Any comments are welcome regarding style and conventions, etc., as well as tips on using the OpenCV library, which I'm new to. Also, ...
user avatar
4 votes
0 answers
819 views

Speeding web-scraping up Python 3

I want to get information from two websites and display it on 'real-time' in the console. To get the information from the website I am using BeautifulSoup 4. I have read, that the bottleneck of ...
OcK's user avatar
  • 41
4 votes
0 answers
380 views

A GUI program for a Buzzer system using arduino

At the outset, I am a beginner at python, having started out about 2 weeks back. Aim- To create a GUI program, that can adequately work as a buzzer-management system. A buzzer, like those used in ...
stochastic13's user avatar
4 votes
0 answers
618 views

Pitch detection library, basic architecture

I'm a mechanical engineer/amateur programmer trying to learn modern C++. I'm working on a personal project where I'm building a library that uses PortAudio to abstract some basic audio processing, ...
mattj23's user avatar
  • 41
4 votes
0 answers
394 views

Linux performance using multi-threads (vs one thread) and ssh message

My server receives requests in one thread and responds in another. I am using thread pools of pthread-s for both receiving and sending. The performance is not that bad, however... When I am doing the ...
Eliad Cohen's user avatar
4 votes
0 answers
5k views

Network Bandwidth Usage Monitor

I have written a very basic bandwidth usage monitor in C++/winpcap. I would like to get some feedback, regarding design choices, implementation, style, correctness. (Or anything else you care to ...
smoothware's user avatar
4 votes
0 answers
85 views

Writing a file sequentially

I've written a procedure which allows serialized writing of a stream. I don't in any way consider this done, but this is the beginning of it. I know there are other implementations out there like this,...
Megan's user avatar
  • 41
4 votes
0 answers
411 views

Producer-consumer with a twist (consumer is a reader) in C++

Executive summary The twist is that the consumers do not consume, they just read. The producer makes items continuously in one of two alternating slots. Readers read from the other slot. When ...
Adrian Rosoga's user avatar
4 votes
0 answers
117 views

Project Euler #2 in Go

I just learned Go (yesterday in fact) and today I made this solution to Project Euler #2. The problem is to sum the even Fibonacci numbers. My program uses the matrix representation of the linear ...
hacatu's user avatar
  • 462
4 votes
0 answers
1k views

Multithread debug logger for Free Pascal / Lazarus

Debug experience can be much improved in the Lazarus development interface. Please, if you use this free development environment and have the same felling, do not consider this affirmation simply as a ...
cpicanco's user avatar
  • 499
4 votes
0 answers
144 views

Building hundreds of C++ components using multiple threads

I'm pretty new to Perl (and multithreading), so I was wondering if someone would be willing to take a look at my script and give me any tips on increasing performance. Motivation The script is ...
MrDuk's user avatar
  • 141
3 votes
0 answers
855 views

C# Procedural Mesh Generation Optimization

I'm making a terrain-deformation system in Unity that utilizes the common marching-cubes algorithm. So far I've gotten the system working, employed Unity's job system and burst compiler, and managed ...
Seth McCann's user avatar
3 votes
0 answers
283 views

Metronome in Rust, Audio Handling and Threading

for learning purposes (and I found it kinda useful), I built a very basic command-line based metronome in rust. It's the first actual smaller project I built in rust. It consists of 4 source files. ...
stekepego's user avatar
3 votes
0 answers
2k views

OpenCv webcam streaming class for WPF

My goal is to make a class that wraps the complexity of OpenCvSharp implementation to show a webcam streaming into a WPF Image. ...
user avatar
3 votes
0 answers
2k views

ConcurrentDictionary performance

i need to improve the performance of ConcurrentDictionary. for that i created 2 classes for check if the more efficiencies than the original. ...
David Michaeli's user avatar
3 votes
0 answers
111 views

Multithreaded OpenGL Rendering Pipeline

I've decided to move my rendering code to a separate thread, to help facilitate the move I've created a pipeline system for rendering. With this pipeline I can insert commands into a queue which will ...
vandench's user avatar
  • 153
3 votes
0 answers
1k views

C++ Producer / Consumer multi threads pattern with maximum container size

I've just written a Producer / Consumer pattern templatized that should work in multi threads environment (IE producer(s) and consumer(s) in separate threads). The original use case is one producer ...
Romain Laneuville's user avatar
3 votes
0 answers
939 views

Using Python threads to download images

I am using Python threads to download images. I have a JSON file that contains URLs to the images in the following structure: ...
liz's user avatar
  • 31
3 votes
0 answers
1k views

Linked list with hand-over-hand locking

Follow-up to this question: after reading the comments, I decided to redesign my linked list to have a cursor that only contains one node and implement the interface similar to the one of forward_list ...
nhtrnm's user avatar
  • 183
3 votes
0 answers
193 views

Override prototype inside of constructor of ES6 class for dependency injection

We implemented a small dependency injection mechanism which we use in our project. Now after 2 years of developing our project we need our classes to know who instantiated them via dependency ...
stephan.niedermayr's user avatar
3 votes
0 answers
35 views

Architecture for a parsing tool

PostgreSQL, Python 3.5, SQLAlchemy I have a main database which has a journals table containing 30k+ journals. For each journal I have a RSS feed URL, using which I can parse and get new articles. ...
Prim's user avatar
  • 131
3 votes
0 answers
114 views

Queue-based fixed-duration memory cache

I used to use the MemoryCache in .Net but recently read about a DB using using a linked-list, which only had to check the prefix of the list in \$O(1)\$ complexity, to time values out, as opposed to ...
Henrik's user avatar
  • 81