Multi-threading is how work performed by a computer can be divided into multiple concurrent streams of execution (generally referred to as threads).
4
votes
0answers
11 views
Lightweight asynchronous event library in C - Threadpool module
I have finished writing a C library whose purpose is to provide a simple API for asynchronously executing functions, waiting for events on file descriptors and waiting for timeouts. The whole library ...
5
votes
1answer
32 views
Expanding url from shortened url obtained from tweet
I have a twitter data set. I have extracted all the expanded urls from the json and now am trying to resolve the shortened ones. Also, I need to check which urls are still working and only keep those.
...
1
vote
1answer
60 views
Player Packet System
I have recently coded a system where an instance of class Player is created for each connected socket, once the player class has been created, in its constructor the Socket that connected starts ...
1
vote
0answers
43 views
Two priests talking to one another
It's a part of code where two Threads ("priests") talk to each other. One asks and waits for the second to answer - then something happens depending on what has been answered by second thread.
I ...
1
vote
0answers
60 views
Sync SQLite databases using threads and a Service
I have an Android app that collects data in n number of SQLite databases. The user decides the value of n in runtime. A Service is in charge of sending that data to our server. We used to do this with ...
1
vote
2answers
44 views
Simplified LogService (from concurrency in practice) with shutdown feature
Brian Goetz provided following code of LogService with shutdown feature:
...
2
votes
1answer
43 views
Parse the response from http call and populate multiple maps
I have to parse a response after making HTTP call on the server. If the response is not successful then try another server otherwise parse the successful response and populate two ...
8
votes
2answers
69 views
Java queue with dynamic priority flag
I need to build a queue where the elements will be added and removed in chronological order by default. But if the client sets the priority flag for the queue I need to be able to pull the elements ...
3
votes
0answers
35 views
Partition numbers as polynomial, each number in a thread
I'm beginner at multithreading programming and I wanna write a piece of my code using it. I'm trying to split different numbers into multiple parts and store them as a polynomial. I wanna do this ...
1
vote
0answers
38 views
Mutex implementation without built-ins
I want to implement simplest mutex without built-in functions or the <pthread.h> module.
...
2
votes
0answers
40 views
Multithreaded chat application in python
I wrote a multithreaded p2p chat application with Qt, and I'm hoping for some feedback. I know there's some deficiencies with error handling, but I'd like to know what else I'm missing. Thanks!
<...
2
votes
0answers
31 views
Asynchronous service that publishes a possibly infinite amount of events
I want to implement a service that fetches eyetracking events and publishes them to all subscribers of the stream. The whole thing is supposed to run asynchronously, so it doesn't block the UI thread. ...
4
votes
2answers
73 views
Multithread the variant of matrix multiplication
This is matrix multiplication. Big matrix split on the submatrix and multiplication in parallel, result matrices merge to result. How i can make this code better?
...
1
vote
0answers
34 views
Thread class that uses std::unique_ptr
I have implemented a class which encapsulates a thread of execution and provides an interface to send messages to it. It is based largely on an article written by Herb Sutter in 2010. It also uses the ...
2
votes
0answers
43 views
Read bytes array from file, process and write to another file using multithreading
I was trying to read data from a file and after processing data write it to another file. Reading and writing do not need much CPU time, so I think it would be better if I use multithreading and ...
3
votes
1answer
49 views
TCP retarder for network delay simulation
I would like to simulate delay over network, for that I have implemented a simple retarder (=introduce random delay while maintaining order of messages) using Boost to handle sending itself. It ...
2
votes
2answers
134 views
Running multiple producer and single consumer in a multithread environment
I have a below class in which add method will be called by multiple threads to populate messageByChannelReference concurrent ...
0
votes
1answer
27 views
Model for starting a thread with an initial value, pausing, resuming with a new value and stopping a thread
Here is a design to achieve a simple model in Java which uses a Thread and has these features:
Starting the thread with an initial value
Pausing the thread
...
2
votes
2answers
50 views
ASCII to Binary and reverse in java
Here is a simple app that i am trying to implement in java.
my goal is to write a program that can convert ASCII to Binary and back.
Questions:
Am i violating any OOP Rule.
Is my code readable ?
...
5
votes
3answers
232 views
Brute-force Vigenere Cipher using multiple threads
I'm trying to brute force a Vigenere Cipher knowing only that the key length is 5+ characters and that the decrypted text has the word ...
0
votes
1answer
56 views
Multithreaded cURL wrapper
The following is a class for curl wrapper.
This class will be called like:
...
1
vote
0answers
52 views
TTimerThread - Threaded timer class
I was inspired by @LU RD's answer to the question: Using VCL TTimer in Delphi console application, and wrote a bit simplified TTimerThread class.
By simplified I ...
2
votes
1answer
52 views
Loading interstitial adMob in different threads
I want to load Interstitial AdMob after 5 second, after the Activity started, in another Thread. Is this code right, or I'm duplicating ...
0
votes
2answers
57 views
FutureTask in Android, wait for a thread to execute the next one
This code is executed on a background service every 60 seconds on an Android app. Each class instantiated on FutureTask (WifiInfoFetch and WifiApResults) contains an insert to an SQLite database. We ...
0
votes
1answer
32 views
2
votes
2answers
64 views
Custom log4net raising application-level events
Use Case: I have a form application in which I log events to a file/database and have a need to also raise those events to the application itself (for display purposes). Think old school updating ...
2
votes
0answers
26 views
Concurrent ObjectPool using ConcurrentLinkedQueue
Main ObjectPool Class: It uses atomic operations and a concurrent linked queue to achieve the best performance compared to Apache commons pool. I want to make sure there are no concurrency issues even ...
5
votes
1answer
54 views
Concurrent stack in C - follow-up
This is a follow-up question to Concurrent stack in C
The pop function not just removes the top element from the stack, but also returns it.
If a pthreads call ...
1
vote
1answer
43 views
Did I overuse / underuse threading locks in my custom list class?
I am writing a Python module in which two threads access one list. One thread adds 500 items to the list per second, and the other thread reads the list at an irregular interval. I want to make a ...
2
votes
0answers
83 views
Multiple readers, single writer synchronization
This is educational purpose "simulation" of multiple readers / single writer server.
No actual work is done, except the synchronization. In current realization, readers have priority over writers.
<...
5
votes
1answer
78 views
Single-thread worker in multi-thread webservice
There is standalone WCF webservice, which is providing methods to interact with legacy ERP system.
This system exposes an API, which allow programmer to interact with it.
The problem is that, for ...
3
votes
2answers
77 views
My first attempt at multithreading in C# with Prime Numbers
This is my first attempt at multithreading in C#. This entire program does several things with prime numbers, but the part I'm going to post is mainly focused with printing out all prime numbers ...
2
votes
0answers
60 views
Thread-safe RLockedList
I have written a thread-safe list which can be used as a drop-in replacement for a regular list. This has been tested and used internally without issue, but "The absence of evidence is not evidence of ...
4
votes
1answer
79 views
Multi-threaded code to handle messages from a provider
Having a look at my code, is there a way to be losing elements?
...
0
votes
0answers
32 views
Queue that permits at most X simultaneous operations
I ran into this once (permits=N) and then again today (permits =1) where I only want 1 to N operations running simultaneously. One example comes from firing into a state machine (the permit=1 example)...
0
votes
1answer
56 views
Single producer single consumer command queue
I needed to create commands simply with lambda and execute it in another thread. The following code works fine. Any suggestions about performance are appreciated.
I want to use SSE aligned variables ...
4
votes
2answers
103 views
C++ Wrapper for cURL: Multithreading and serializing asynchronous ops
I did this library to help me from one of my projects and decided to publish it on GitHub hoping people might find it useful, convenient and easy to use in their projects too.
It's a header-only ...
6
votes
1answer
84 views
RabbitMQ wrapper to work in a concurrent environment
I'm developing a common library for my organisation that will be used across different services by different teams. The library is a simple wrapper for RabbitMQ.
Some services will only be producers, ...
2
votes
0answers
52 views
RCU in C++11 using std::shared_ptr and a little more
Here's some code I wrote to solve a problem at the server I'm working on. Is this valid? I've tested it, and it works, but I would like some opinions on this.
It's basically a ...
4
votes
2answers
178 views
Multi-thread safe buffer in C++
I am trying to design thread-safe data structure that I cna use as a buffer in my application. Can you please give me comments about this code and what can be improved:
...
1
vote
0answers
27 views
A simple thread safe LRU cache using unordered map and lists in C++
I am learning concurrent programming and am writing a thread safe LRU cache for practice. Below is my first attempt. Kindly comment and let me know where I can improve.
PS: There have already been a ...
6
votes
2answers
102 views
Concurrent stack in C
(See also the follow-up question.)
I was in the mood for pthread.h and decided to write a concurrent stack data structure. My requirements:
the stack has maximum ...
4
votes
6answers
352 views
Loop for periodic processing in a background thread
Occasionally I need to implement periodic checks in a loop in a background thread, a typical example being asynchronous processing using a message queue. While it’s not terribly complicated, I wonder ...
7
votes
2answers
117 views
Thread worker simulator
Because I have been writing more multithreaded C++14 code lately, I've developed some tools that help me make sure that my threads are all working as intended. In the real code, it's often difficult ...
4
votes
1answer
72 views
Safe handling of variables in multi-threading application with shared resources
I've been developing this application as my first C++ project and am at a point where it is functional and would like to take a step back and critique/improve my code from a standpoint of ...
6
votes
2answers
396 views
Creating multiple threads to process items in a listview
The goal is to pick items from a listview, do some web related task with the information and then update the UI with the returned information from the web request.
The problem is with having multiple ...
1
vote
4answers
114 views
Socket client in C using threads
I'm working on socket programming in C. I have no problem with usage the threads. This all works fine but I'm new in this area. I wrote this code in client.c but is there any misused code or something ...
5
votes
1answer
61 views
Collection to hold maximum number of running Tasks
I need a collection/bag (something) that will hold some maximum number of running Task objects. Adding a new running Task to the ...
6
votes
2answers
65 views
Synchronization of transaction processing
There's a server which does the following:
Receive request with transaction id
Load corresponding transaction from storage. New transaction object is returned each time
Process transaction
Save ...
3
votes
1answer
51 views
Multithreaded Monte Carlo pi approximation with own pseudorandom number generator
I made a Monte Carlo pi approximation program, that makes use of multithreading and a pseudorandom number generator I wrote (the one from big_wheel.hpp, which I ...