Multi-threading is how work performed by a computer can be divided into multiple concurrent streams of execution (generally referred to as threads).
3
votes
0answers
58 views
Naive lock free work stealing queue
Recently, I read a article about work stealing queue Job System 2.0: Lock-Free Work Stealing – Part 3: Going lock-free, and this is my c++11 naive implementation based on my understand of c++11 ...
2
votes
1answer
42 views
Read characters slowly (Threading with delay, .NET Framework 2.0)
Couple of months ago I was asked to develop a console app to do the following:
Write an application that takes an array of ICharacterReader
interfaces, accesses them in parallel, and outputs a ...
2
votes
2answers
43 views
Static ConcurrentDictionary to maintain static objects
I am using following code to maintain some static information. The problem I see with it is that, if the information retrieved using GeKeysFromCache is modified without using lock keyword it may lead ...
2
votes
0answers
27 views
Ping Multiple sites via python
Here is a simple script that i am using to ping 50 sites at a time and check if they are up or not. If not, save the down time with error in mongodb
Code:
...
5
votes
0answers
281 views
Increase the speed of this python code for text processing
I need to iterate through a file of words and perform tests on them.
...
0
votes
0answers
32 views
Use of Static Dictionary Across Different Instances of a Class [on hold]
I have a class which will have two instances and those two instances will be accessed by two different threads. I want to have a dictionary that is accessible from both the threads(with different ...
-1
votes
0answers
43 views
Webscraper using threads and grequest in Python
I have to scrape a government website and retrieve the information about a food's particular calorie information. I wrote a program that does this. I have been all over the internet looking at ...
1
vote
1answer
47 views
IP Scanner via python sockets
Please review my code for scanning active IP address . Please Suggest improvements ...
...
6
votes
1answer
57 views
Simple slack bot in python
I wrote a simple slack bot, which is able to save links (command: "save name link") and print them (command: "get name"). Optionally, a delay in minutes and seconds can be specified (command: "get ...
-3
votes
0answers
33 views
RingBuffer with Spin
What do you guys think about the following code? Is there any potential thread issue?
...
6
votes
3answers
119 views
Concurrently reading a Map while a single background thread regularly modifies it
I have a class in which I am populating a map liveSocketsByDatacenter from a single background thread every 30 seconds inside ...
10
votes
1answer
111 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 ...
6
votes
1answer
51 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
74 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
45 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
76 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
46 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
75 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
36 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
39 views
Mutex implementation without built-ins
I want to implement simplest mutex without built-in functions or the <pthread.h> module.
...
2
votes
0answers
47 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
32 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
77 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
40 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
45 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
150 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 ...
1
vote
1answer
31 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
58 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
253 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
91 views
Multithreaded cURL wrapper
The following is a class for curl wrapper.
This class will be called like:
...
1
vote
0answers
59 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
56 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
66 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
33 views
2
votes
2answers
71 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
28 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
57 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
45 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
104 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
81 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
86 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
35 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
62 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
126 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
96 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
60 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 ...