Multi-threading is how work performed by a computer can be divided into multiple concurrent streams of execution (generally referred to as threads).

learn more… | top users | synonyms (2)

4
votes
1answer
35 views

Parallelizing an algorithm with OpenMP using a dynamic work queue

I'm looking for comments on the design, correctness and performance (not so much style) of a dynamic work queue for OpenMP worker threads. I have an algorithm that can be thought of in terms of some ...
4
votes
1answer
53 views

Loop through List multi-threading to ping hostnames

I am new to Multi-threading. I have had a go at writing some code that loops through an ArrayList, gets a hostname and then pings the hostname. If the hostname is ...
0
votes
1answer
27 views

Kill/stop a busy FutureTask Thread

I am trying to get an Auth ticket from a 3rd party server. I am using FutureTask to perform the task. However, if I don't get response from the server after 10 seconds, I want to timeout the call. At ...
6
votes
1answer
51 views

Cancellable UI loader

I'm playing with async/await, but I have yet to discover a standard method to safely cancel an intensive task. I have tested the following, and it works exactly as intended, though I remain unsure if ...
4
votes
1answer
141 views

Starting and stopping a thread for a command handler

I built an application class that should be runnable as a Thread and it would be nice to hear opinions of Java developers to improve my coding style. ...
3
votes
1answer
152 views

Background task with instant abort capability in c#

I'm looking for a better way to make a background operation with abort/cancel support. Right now I use this approach: ...
5
votes
3answers
95 views

Simple Java task scheduler

The task is pretty simple: implement a timer that executes tasks when the next event takes place. I created a task scheduler based on a priority queue. A new thread is created for ...
0
votes
1answer
60 views

Printing odd and even numbers with two threads

I would like to refactor this code printing odd and even numbers with two threads considering agile practice: ...
6
votes
2answers
99 views

std::once_flag and std::call_once implementation

I'm implementing std::once_flag and std::call_once for a particular MinGW build where they are not available, using only stuff ...
8
votes
2answers
142 views

Command line IRC client

I made this IRC client ages ago in Python, and thought I'd revisit it for Python 3.5 (I'd like to play with asyncio). Before I start, I'd like to have an overall design review about this. Known ...
5
votes
2answers
56 views

Multi threaded Producer Consumer with bounded buffer

I've developed the following multi-threaded code and would like a review. It is supposed to be implementing the Producer-consumer problem as defined here. I have multiple consumers and one producer. ...
3
votes
2answers
162 views

Handling events in a multi threaded environment

I have a service that raises multiple events, some of them can be raised at the same time. I need to process those events and run a potentially long running method based on the event arguments. What I ...
5
votes
1answer
54 views

Dining Philosophers using C11 threads

I wanted to try multithreading out in C, so I did Dining Philosophers using C11 threads with the approach of having one of the philosophers left-handed. Any suggestions? ...
0
votes
1answer
93 views

Java MultiThreading using wait and notify - follow-up

After following the tips from @VoiceOfUnreason on my previous question, I want to post the revised code. The purpose of the code is to simulate a Shop and a ...
2
votes
1answer
75 views

Java MultiThreading .wait() .notify()

I have been working on a long project trying to understand the basics of multi-threading. The application is supposed to simulate a Shop and a Customer which share a Box and a PayPal account. ...
11
votes
2answers
69 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
1answer
75 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 the user connects to ...
7
votes
1answer
62 views

Server-side of a chat application

I have written a server-side and the client-side of a chat application. I would like to improve it and I am unsure about my server construct and have absolutely no idea if there is a better way to do ...
7
votes
3answers
472 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
60 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
2answers
66 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
118 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
25 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 ...
5
votes
1answer
92 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
307 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 ...
10
votes
3answers
433 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
vote
0answers
11 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 ...
4
votes
1answer
76 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
42 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
159 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
58 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
75 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
109 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
127 views

Priorizatable command queue

This code consistently executes commands with a given priority. How can I to improve it? ...
3
votes
0answers
51 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
83 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
2answers
35 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
51 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
38 views

Custom connection pool : performance

I have a project, that creates a custom DataBaseConnection pool as below: ...
4
votes
1answer
84 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
165 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
99 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
38 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
134 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
33 views
4
votes
2answers
88 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
49 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
60 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
41 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
134 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 ...