Multi-threading is how work performed by a computer can be divided into multiple concurrent streams of execution (generally referred to as threads).
1
vote
1answer
68 views
Skeleton of a Multi-threaded web crawler in Java
I am trying to prototype a simple structure for a Web crawler in Java. Until now the prototype is just trying to do the below:
Initialize a Queue with list of starting URLs
Take out a URL from Queue ...
5
votes
2answers
72 views
Thread synchronization with mutex
This program prints odd numbers by thread1 and even numbers by thread2 sequentially. Can this code be optimized or made more ...
0
votes
0answers
41 views
Parallel integer tree sort algorithm in Java
Introduction
In this post, I will present a parallel sorting algorithm for sorting primitive integer arrays.
Treesort
Treesort is an algorithm which iterates over the input array and constructs a ...
1
vote
3answers
71 views
C++11 Blocking Queue learning exercise
As part of my own C++11 learning exercise I have implemented this Blocking Queue using the new C++11 thread API. One of the aspects I would like to improve is efficiency i.e. in the ...
1
vote
1answer
55 views
Improving GUI update call from a worker thread in winforms
I have a winforms app and I've been using the following approach to update controls on the main form from worker threads:
GamepadManager class has:
...
1
vote
4answers
312 views
Reading HTML files, removing HTML tags, and writing content and summary to a file
Write a multithreaded C++ application (executable) for Windows
Platform. This program uses the two threads to read and process the
input data and store it into an output file. Candidate is free ...
3
votes
3answers
440 views
Finding the tree height in Python
I'm trying to get an efficient algorithm to calculate the height of a tree in Python for large datasets. The code I have works for small datasets, but takes a long time for really large ones (100,000 ...
0
votes
0answers
42 views
Block a partcular machine for a particular period of time interval after x failure
This is an extension to this question
I am working on a library which makes Http call to my service. I have below two requirements:
If my service machine doesn't respond back (there is a socket ...
1
vote
2answers
68 views
Dynamic Multi-threading lock with while loop
I have already asked a question about dynamic multi threading lock, and the reviewer found a problem.
Here is the description of the problem that I need to solve: "I need to create an structure to ...
3
votes
1answer
68 views
Dynamic Multithreading lock
I need to create an structure to control dynamically locks. For example, I have 100 threads running, and each thread will "process" a "key". Sometimes two threads could be processing the same "key", ...
1
vote
1answer
35 views
Custom countdown timer class to replace the Android CountdownTimer
This project was made to replace the stock Android CountdownTimer class. It is more responsive when completing the timer and adds additional functionality such as ...
5
votes
2answers
320 views
Android splash screen
I have implemented a splash screen, to hold/pause the screen for few seconds and then launch the next screen. I am very enthusiastic to know if there is a more basic way to write the code.
...
0
votes
0answers
31 views
Livelock simulation
I want to understand how Livelocks happen and also how to translate my thought in to working code. I have written the following snippet to simulate a livelock between two persons passing each other in ...
9
votes
0answers
225 views
Efficiently using Apache HttpClient in multithreaded environment
I have a library which is being used by customers and they are passing DataRequest object which has userid, various ...
1
vote
0answers
28 views
Automatic resource allocation for the purpose of resource-dependent task scheduling
Here is what I'm trying to accomplish: Suppose you are trying to control an embedded system with several external hardware resources/components/devices. Naturally, you are concerned with the issue of ...
1
vote
2answers
60 views
Small C++ thread pool
I've made a small thread pool that i'll be using to communicate with a Redis server:
...
1
vote
0answers
17 views
Using RemoteChannels for an parallel iterable map
RemoteChannels hit with julia v0.5
There are no examples online, but I managed to get them to work.
They are still very new, and all this whole area of multithreading code continues to have running ...
1
vote
0answers
27 views
Loading sub items of TreeView in background
I am working with a TreeView (default control from .Net Framework) that displays hierachical data. Data are bound to the view using MVVM pattern with the ...
1
vote
0answers
32 views
Methods to add and check elements in a Bloom Filter
I have a working Java implementation of Bloom Filter.
These are the methods to addElement and check for an element.
...
1
vote
0answers
68 views
Portable periodic/one-shot timer thread - follow-up
This is a much improved version (I hope) of code in this previous code review of mine.
I have:
renamed several things. Are the names good?
made it lazily start the worker thread only after the ...
3
votes
0answers
39 views
Reader-writers problem using semaphores in Java
I have written my own solution to the Reader-Writers problems using semaphores based on the psuedocode from Wikipedia. I would like to gauge the correctness and quality of the code.
...
3
votes
2answers
35 views
Thread Safe Servlet
I am working on a JSP MVC web application. I am confused about Thread-Safe Servlet concept. Following is my code, please tell me is it thread safe or not. Also, tell me the reason that why it is ...
0
votes
0answers
32 views
Multithreaded client socket
This is my first time working with networks and multithreading in C, and would like to know how to make improvements.
I wanted to make a client program that handles reading and writing to the server ...
4
votes
1answer
53 views
Multiple Persons enter room simultaneously and exits after specific interval of time
Here is the link to git repo of my application I am currently implementing just to have better understanding of OOP as well as learning Concurrency (Atleast a try :D)
What is the whole ...
2
votes
1answer
410 views
Thread class for exercises
I just felt a sting as for the first time, I copy-pasted code blocks, and made very little change to it, to overload it. It works fine, but I have 3 constructors that are basically copy-pasted. I'm ...
3
votes
2answers
98 views
Threadpool implementation in C++11
I am implementing a very primitive threadpool with C++11 using mutex and conditional variable. The class ...
2
votes
2answers
52 views
Creating a ticker thread - version 2
In this question, I asked for feedback on a class that provided my program with periodical signals.
I have rewritten that class based on the feedback from the accepted answer. As this again uses a ...
3
votes
1answer
148 views
Java Multitasking (String concatenation)
I would like to know if I did everything right and if there a way to do it more simple?
Task:
Task link to html file
My main:
...
-4
votes
1answer
69 views
Multithreaded AES encryption [closed]
I am trying to implement Lowering speed on my hybride encryption function for large files but can't seems to successfully bug fix a few issues.
How do I deal with the while loop in this ...
3
votes
0answers
36 views
Producer Consumer in C
I'm doing multithreading at university and we've been asked to implement the producer consumer problem in C.
My code compiles and produces the right result. From debugging it, it seems to be waiting ...
4
votes
0answers
43 views
Delete engine for deeply nested linked structure
The background is the question at http://stackoverflow.com/questions/36634394/nested-shared-ptr-destruction-causes-stack-overflow. To summarize, for a data structure that looks like:
...
4
votes
2answers
70 views
Play around with wait and notify
The following is an a self-tutored attempt to take a leap into understanding simple usage of wait() and notify() methods.
The ...
2
votes
1answer
88 views
Creating a ticker thread
A new question about a revised version of the code in this question, based on the advice in the accepted answer can be found here.
I need to signal my program to do something every X seconds. So I ...
2
votes
2answers
43 views
Copy directory to multiple directories - I/O performance matters
I am working on below python copy utility that should work on windows & linux,
But I am looking for a more efficient approach that could optimize my I/O correction, as my target location is ...
1
vote
2answers
49 views
Spawning futures as an alternative to multithreading
I was trying to do a sample threading program, where the spawning of thread is in a while loop. I DO NOT want to generate multiple number of threads. The while loop should keep on running, ...
1
vote
1answer
36 views
Powershell task to poll SQL database for psexec commands to run
We have a requirement for a script which polls an SQL database for scrape commands which need to be run. These commands are added to the SQL database on an ad-hoc basis. The scrape commands themselves ...
1
vote
1answer
46 views
Multi-threading upload tool
We have about 14G files and each is about 150k.
I'm writing a script to upload them to Azure Blob storage and would like to run an upload() function (each with own ...
0
votes
1answer
44 views
Design of thread pool reuse with Executors.newFixedThreadPool in Java
In my application I have code which should run every hour on a new items and execute some expensive operation with multithreading:
...
6
votes
1answer
46 views
Thread-safe algorithm to make trades based on moving window of prices
Here is problem to be solved
TradingAlgorithm employs a trading algorithm which, based on the prices it receives, will return a trade to execute.
The trading algorithm must implement the ...
2
votes
0answers
24 views
Memcached load generation
This is working but right now it is not giving me the throughput that I want. The main function has the load generation loop (where it is putting work in Queue). I ...
1
vote
1answer
51 views
Performance issue in generic sql utility
I recently working in .Net field and under circumstances had to write a program to execute sql from external source file.I have written the code and works fine but when it goes to Production server,It ...
5
votes
1answer
34 views
Fetch data from co-processor on network in background
My code communicates with a Raspberry Pi (with a static IP address) running on a network. The client sends a signal to the Pi, and the Pi sends back a double (encoded as a string) with the angle ...
7
votes
1answer
145 views
Lock-free multi-producer multi-consumer queue
I'm looking for some feedback on my lock-free queue, based on Disruptor, mainly for any potential concurrency issues, such as where I need additional fences. It looks correct to me, and I can't seem ...
3
votes
1answer
41 views
Run tasks in parallel using limited number of threads
To learn about concurrency in Clojure, I wrote a function that accomplishes the following:
Takes a (possibly lazy or infinite) sequence of functions representing tasks to be run asynchronously
Runs ...
3
votes
1answer
137 views
Initialize and sum an array in Java using threads
This bit of code initializes an array of any given size where each index corresponds to a thread and a value. That is, index 0 has 0, index 1 has 1, and so on. Then, the values, 0 to n, in the indexes ...
3
votes
0answers
85 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 ...
-1
votes
1answer
36 views
0
votes
1answer
57 views
Long running in-process Publish/Subscribe class
I have a Pub/Sub class that will call Notify() when published and that Notify() could take around 10 seconds, so I need to make ...
3
votes
2answers
131 views
Queuing e-mail notifications in a background thread
I'm new to parallel programming concepts. I'm trying to implement fire-and-forgot kind of method in my project. Somebody please evaluate the below code & let me whether this is thread safe or not.
...
4
votes
1answer
54 views
Java NIO server Selector loop
I have a server that uses Java NIO in non-blocking mode. Right now I'm using a single thread for the selector, and four worker threads to process the bytes after ...