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
9 views
Multi-threaded Command Processor
I have written a class that is intended to execute a unit of work to be run in a separate thread. The intended use case for this class is running business logic off of the user interface thread so as ...
-4
votes
0answers
19 views
Abort all running threads from the one (not main) thread C# [on hold]
I have rather strange question, but I needed to be done. So, this is my code:
...
2
votes
0answers
32 views
Task Scheduler for small interval and one number of start
Scenario
I want a task scheduler that enables my application to schedule some tasks in small time interval. I want to use it in my socket server application. For example: when user connected to ...
7
votes
3answers
271 views
Measuring performance of code using StopWatch
I have created a StopWatch class to measure the performance of any code. I use this StopWatch code in any of my multithreading projects as well.
...
6
votes
1answer
54 views
C++11 version of Windows EventWaitHandle
I don't know C++ at all, but for the heck of it I tossed this together because I was talking with someone about C++ and was given the impression there is absolutely nothing quite like the windows APIs ...
7
votes
1answer
52 views
Updating resources while avoiding race conditions
I am writing a utility class for a game client. This class has two main functions: connect to a game server and retrieve the current game revision, and retrieve a "recipe", which is basically ...
5
votes
1answer
106 views
C# - Make the static class thread safe [closed]
I have a simple class that I use to logging errors and other informations from my applications.
I wondering what will happen when 2 or more threads of the same application would like to log something ...
1
vote
0answers
16 views
ByteBuffer Performance with Java NIO2 AsynchronousChannelGroup.withFixedThreadPool
I have a socket which will be receiving more than 100 TPS, so I need the reading to be as fast as possible. In this socket, I read the info I need to build a String and check if it matches a regex. I ...
7
votes
1answer
47 views
Handle concurrent request by waiting the result of an already running operation
I need to handle concurrent request by waiting the result of an already running operation.
Requests for data may come in simultaneously with same/different credentials.
For each unique set of ...
17
votes
3answers
262 views
Synchronous / asynchronous REST client
I have working code with original design, and now I had a slight design change so trying to code review that as well. I already had code review on my original design here.
Original Design:
I am ...
8
votes
3answers
414 views
Multithreaded Mandelbrot Generator Ver 2
Update: Version 3 is here.
My first version was an answer I provided to EBrown for his original post titled "Multithreaded Mandelbrot Generator". My answer had many good things in it, but I felt ...
-1
votes
0answers
27 views
Show status images according to background worker
I work with WPF and have application which try to take data from server.
This logic is inside background worker Do_Work event:
...
1
vote
0answers
10 views
Race condition while reading N sheets of one excel workbook using different threads [closed]
There is an excel work book of 7 sheets each with 65000 records. I am using 7 worker threads to read each sheet in parallel and process them thereafter with no write operation involved. For small file ...
3
votes
1answer
66 views
Calling a method in parallel which returns the future
I have an async method which calls my Task class while my Task class does all the work:
...
2
votes
0answers
41 views
N Processing connect to a single process: Socket Programming
The idea of my program is to use pthreads, semaphores, posix shared
memory, and sockets to create an environment where N processes
(that we will refer to as the children) can connect to a single
...
4
votes
3answers
126 views
Finding prime numbers in user specified array
I have a program that searches for prime numbers in an array specified by the user. The program starts by asking how big the user wants the array to be, then asks how many threads to split the ...
2
votes
2answers
51 views
Ensuring that events raised by system.diagnostics process class happen in the parent thread
I'm quite new to threading primitives in C# and was hoping you might be able to suggest improvements to this. I need to ensure that the XXX call below happens within the calling thread (XXX is a ...
2
votes
1answer
74 views
Multithreading fitness calculation of a sequence in a math function
I wrote this program to calculate a value from an energy function from a sequence of 1s and -1s. The problem here is to find the lowest possible fitness for a function (note that this is original ...
3
votes
1answer
91 views
Monitor, read and display data from a dynamic log file
I am developing a plugin for intellij that basically monitors a log file and displays the data in a tool window within the IDE in real-time. I have managed to get it working but I would like to know ...
6
votes
1answer
112 views
Priorizatable command queue
This code consistently executes commands with a given priority. How can I to improve it?
...
3
votes
0answers
39 views
Self-stopping started and bound Android service
I've written a small Service class that contains a thread pool so that it can process multiple tasks in parallel. The kicker is that is also allows clients to bind ...
5
votes
1answer
69 views
Simulation of Multiple Producer Consumer
I am trying to implement the Multiple Producer-Consumer problem. I have made the buffer as the lock to maintain consistency of the system. Does this system actually implement multithreading? How can I ...
2
votes
1answer
25 views
Single reader - multiple writer waitable lock-free unreliably ordered stack
The main body of code is located here. In the code linted_error is a platform specific type for error codes. As well, as an optimization the code can use Linux ...
1
vote
1answer
41 views
JavaFX await implementation
I'm debating trying to take a crack at getting something similar to C#'s async-co-routine like nature over on JavaFX.
This is technically feasible since the Quantem toolkit exposes the ...
0
votes
0answers
34 views
Custom connection pool : performance
I have a project, that creates a custom DataBaseConnection pool as below:
...
4
votes
1answer
71 views
Simple Python chat
I am working on a simple console chat in Python. I started from this Winforms application, removed all the forms (so that the chat could run on Windows and Linux) and did some refactoring (the "click ...
-5
votes
1answer
151 views
Blinking console start menu
gotoxy() allows you to place the blinking text wherever you want. I wasn't able to get it to behave the way I wanted, so you will notice I had to insert a bunch of ...
2
votes
1answer
76 views
Multithreaded Webcrawler in Java
I am working on a multi-threaded webcrawling program in Java. Each WebCrawler starts at a root page and repeatedly extracts new links and writes them to a database. ...
3
votes
1answer
34 views
Synchronization algorithm for deterministic context switching between threads
Curious how sqlite3 would handle different race conditions in a multithreaded environment, I created a simple module called deterministic for serializing the ...
0
votes
1answer
68 views
Case of System.Timers.Timer vs System.Threading.Timer
I have a console application that I want to use to send an email notification every day at some time (call it 06:00 local time). To do so at the moment I am using a ...
0
votes
0answers
23 views
4
votes
2answers
72 views
Parallel foreach with configurable level of concurrency
The purpose of this code is to let me loop over 100 items (up to MAX_CONCURRENT at a time), performing some action on them, and then return only once all items have ...
0
votes
0answers
40 views
Threadsafe Logger with scopetime logging
I wrote a Logger which uses the destruction of temporary objects to Log their values including a scope time logger. Lets see what i can improve here to increase the performance and everything else.
...
2
votes
1answer
59 views
Multithreading, shared queue as synchronization point
I have two threads, one produces images and one processes them. For the synchronization, I created a class where you can set and get images, and it always waits until an image is available or a worker ...
1
vote
0answers
35 views
Safely aborting thrid-party code using TPL
I'm using some third-party libraries in my project. Once in a while the code in these libraries freaks out and produces infinite loops and other nasty things. My goal is to write a wrapper that allows ...
0
votes
1answer
120 views
Static thread safe configuration class
I wrote this class. I would be very interested in your feedback how much thread safe this class is. I know users of this class must still use some kind of synchronization when using this class, but I ...
6
votes
1answer
140 views
Event dispatcher / listener
I'm working on a program that will be significantly multi-threaded. I need to respond to events between objects and threads so I've come up with the following code.
...
2
votes
1answer
64 views
Daily Log file - Multithread with date and time
I have one window service. At any given time this window service runs 5-10 threads and each thread do some logging on text file. Logging can be exception or some information related to task/job. I ...
2
votes
0answers
29 views
Parallel Multiplier: an implementation of `RecursiveTask<V>`
This class is my attempt at creating a re-usable class that simplifies the parallel calculation of products. I would appreciate hints on all aspects especially the value of the threshold for which the ...
0
votes
0answers
68 views
Multi thread application
A multi-threaded application that will run X (where 1 < X <= 64) subsidiary threads. Each thread adds some common element of a container and removes the oldest element if it was added by another ...
2
votes
1answer
64 views
Thread spawning child threads and waiting for children to finish
Scenario: I have a main thread which spawns few child threads to do some independent tasks. After each child thread finishes their tasks, the main thread proceeds. The code I have written is working ...
5
votes
1answer
48 views
Lock implementation using atomics
I was recently given an interview and was asked to write my own lock implementation using atomics, but not necessary reentrant.
I didn't answer the question, but at home, I wrote this code. Please ...
10
votes
1answer
173 views
“Barbershop”-esque Semaphore Implementation
Recently, I submitted a project that simulates a barbershop-style problem; the task was to create a Hotel that contained guests, front-desk employees, and bellhops. ...
1
vote
1answer
139 views
Thread safe Parameters class (follow up)
This is a follow up question to my previous question. I am trying to design a thread safe parameters class with only readable getters. Idea is it should be possible to initialize this class once with ...
4
votes
1answer
112 views
Read text file filled with numbers and tranfer to an array
This is my ProcessDataFileParallel.Java file. I'm taking numbers from a .txt file and putting it into an array in Java. While it works, I would like to improve the code and possibly change some ...
3
votes
2answers
62 views
Windows Forms `ControlCollection` implementation
I've implemented my own version of the Control.ControlCollection class in System.Windows.Forms and obviously I want it reviewed.
...
3
votes
1answer
99 views
Producer Consumer using custom blocking queue
After the feedback I have got from this question, I tried to to re-implement the classic Producer Consumer problem using multithreading.
The requirements are:
If the queue is not full, all the ...
5
votes
2answers
51 views
Summing random numbers in parallel
I am playing around with parallelization in Java and am trying to see how to squeeze out more performance on my multi-core box. My machine has 6 physical cores, 12 with hyperthreading.
However, with ...
0
votes
3answers
43 views
Implementing multiple Producer Consumer using custom Blocking queue [closed]
I am trying to implement multiple producer multiple consumer problem using a custom blocking queue. The requirement is that:
If the queue is not full, all the producers should be able to produce ...
0
votes
1answer
60 views
Writing to a file in a multithreading application [closed]
This piece of code writes to a file and is used by multiple thread workers at the same time. From my observations, this is the slowest part in my whole application since threads have to wait for their ...