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)

2
votes
0answers
19 views

Generic GUI background task runner (Java 8+)

Here is the culprit; headers omitted for brevity, and also, see notes afterwards: ...
0
votes
0answers
23 views

Optimizing my program by accessing data locally instead of a remote database

I have a database with 4 tables filled with millions of rows. I have my program run on several computers computing data and then returning it to the database. The huge bottleneck in my program design ...
3
votes
1answer
50 views

Simple concurrent freelist

To become better acquainted with the Intel Parallel Studio XE profilers I'm currently messing around with a simple concurrent freelist. I'm fairly certain that it's thread-safe. It uses Acq/Rel ...
-2
votes
0answers
17 views

Convert to Threading and Queues? [on hold]

I'm looking to convert this working code to threading and queues instead of thread and global variables, but am not understanding how to do it. ...
6
votes
1answer
45 views

C++14 Async Task Scheduler

I'm not sure if this site has the right audience for anyone to be able to respond to this, but I wrote a header only scheduler which schedules a task to be run in the future on another thread: ...
0
votes
0answers
26 views

Program to continually read from and write to txt file [closed]

This program is intended to meet the following requirements: Have 2 Classes, instantiated within main The first class needs to create/open a text file, find the last line and display the line-count. ...
5
votes
1answer
69 views

Beat detection algorithm implementation

What is the quality of the code I've written? Is it easy to read or is it a low-quality piece of code? Also, is there any way I can improve the algorithm itself (beside changing C parameters)? ...
0
votes
0answers
39 views

Texture framework library [closed]

I'm creating a C++ framework that could be really useful to the community. I'm writing the best I can with the new C++11 and C++14 standards but I'm not really sure about some things related to ...
1
vote
0answers
26 views

A Simple Thread Pool in Scala

I wrote the following that spawns n threads, uses them to process a queue of jobs, then returns a result. As well as any general suggestions, I'd like feedback on the following: How safe is ...
3
votes
2answers
65 views

Removing synchronization from an agent for a trading system

Is there any way to easily remove synchronization from this code, when there is a validation step before acquiring a lock? I tried an ...
2
votes
2answers
49 views

Pulling thread data from Invision power board from an external java application

What I am planning on doing is pulling the first post of my news section, this was made for V bulletin and now I need to add it for IPb. ...
3
votes
0answers
32 views

Text-based Snake game on Window - follow-up

Previous question: Text-based Snake game on Window Summary of improvements: Removed unnecessary functions such as clearScreen() Added new ...
3
votes
2answers
60 views

Is this a thread-safe implementation of background bitmap generation?

For a game implementation, I have a very large overview map with multiple layers (namely base-map / units / highlight & info / fov-shading) of which the first is CPU-intensive to generate. I have ...
6
votes
1answer
46 views

Throttling commands

I have a scenario where my BaseRepository gets a lot of commands in a short time period. At other moments, this doesn't happen. What I want to achieve is to throttle these commands. I.e., when a ...
5
votes
3answers
108 views

Counting letters as quickly as possible

I received a task, of taking a known text file (Linux dictionary), use threads to count the different letters in it, and present the results in an array. The code doesn't have to be pretty, elegant, ...
11
votes
1answer
107 views

Storing messages for the application's runtime

I am currently writing a well.. manual testing site for a chat-based bot. The full code can be found on github. For that purpose I had to keep track of the messages currently in the "system". The ...
1
vote
2answers
95 views

Updating list of string while others reading it in Java

I have a logging solution that writes down the hashes of messages. I consider some of these hashes to be safe and I want to skip logging those. I have implemented a whitelist that is a directory ...
3
votes
2answers
472 views

Simple Java Game including Thread

I am a Java beginner and have made a simple Compare Game. It has done well but I am not sure about my solution, especially about my thread. Can you give some advice on making it better? ...
4
votes
1answer
42 views

C++11 class similar to .Net's ManualResetEvent, but without the ability to “reset”

The goal is to block all threads that call WaitOne(). When Set() is called, those threads continue. Any calls to ...
4
votes
0answers
39 views

Simple wrapper class for Win32 console

This is based on a library called Consoledefender V 3.3. I made a minimal class for personal usage based on this library by using C++11. It actually takes user input and prints it back on the console ...
1
vote
1answer
64 views
1
vote
0answers
41 views

FTP client/server sockets

I'm working on a project using socket programming to design an FTP server/client application. This is the code so far. What I need to do is add authentication, I want users to be able to access ...
1
vote
0answers
50 views

Threaded Video Player sync

I am developing a video player with the following design: The main thread - is GUI thread (Qt SDK). Second thread - player thread which accepts commands from the GUI thread to play, forward, ...
7
votes
3answers
641 views

Dining philosophers problem in C++11

Is this implementation correct? Do you find any threading problem? Also, what parts of the code can be changed to be more C++11-ish? ...
3
votes
0answers
85 views

Switching between view controllers that are loaded in the background

I have a dining menu app that scrapes the data from a website and redisplays it in a mobile format, displayed below: If the user swipes left and right, the app will show the previous/next meal (ex. ...
5
votes
1answer
56 views

Implement a blocking counter with a reader/writer lock

I'm trying to implement a blocking counter that may have several readers and writers at the same time: ...
7
votes
1answer
160 views

Lock Using “Interlocked” vs lock Statement (“Monitor”) (Followup)

This is a followup to a previous question. Considering: Interlocked.CompareExchange generates a memory barrier, Intended to be used with very fast operations ...
4
votes
2answers
91 views

Lock Using “Interlocked” vs lock Statement (“Monitor”)

A followup question can be found here, based on this question and it's answer. Considering: Interlocked.CompareExchange generates a memory barrier, Intended to ...
4
votes
0answers
90 views

Deadlock watchdog in a server to defend against poorly written extensions

In the Red5 server we have no control over what implementers do with their applications and as such we have attempted to implement code that would prevent them from causing bad things to happen. ...
3
votes
0answers
47 views

Parallel MSD radix sort in Java

I have this parallel implementation of MSD radix sort, which processes the entries by one particular byte. At each byte index, it has three phases: Count the bucket sizes. Insert each entry to its ...
1
vote
2answers
81 views

Class for multithreaded insert into database

Here I have class that supposed to take dictionaries of product objects and their articles (kind of unique identifier) from queue and insert or update them in database table. Received dictionary ...
4
votes
1answer
70 views

Optimize the Buddhabrot

I am currently working on my own implementation of the Buddhabrot. So far I am using the std::thread-class from C++11 to concurrently work through the following ...
2
votes
1answer
82 views

Counting words in files - follow-up

I have made a non-threaded version of counting words. The result was unexpected the non-threaded version was faster than threaded-parallel version. Non-threaded version: ...
4
votes
1answer
128 views

Counting words in files

I made a simple program for my study that calculates words in a text files and prints every word and its repeated times in the files. How can I improve this code? ...
13
votes
3answers
242 views

Printing all even and odd numbers with threads

The original question is on careercup. Write a multi threaded C code with one thread printing all even numbers and the other all odd numbers. The output should always be in sequence ie. ...
5
votes
1answer
44 views

Synchronization Event with awaitAny

In Java, there is no way I know of to wait for multiple events at the same time (see Stack Overflow). Since I would like to use that feature (similar to ...
1
vote
1answer
120 views

TCP Server with multithreading

I am working on a banking application. I want to create a multithreaded TCP Payment Card (iso8583) server that can handle passbook printing requests simultaneously. Multiple devices are connected to ...
1
vote
0answers
25 views

Thread synchronization and happens-before relation in simple examples

I wrote those examples to show different approaches to sharing results between threads. The whole code is on GitHub. All examples should return "Hello world". Are these OK from the perspective of ...
4
votes
2answers
68 views

Code organization when using threads

From OOP & OOD point of view, is it good idea to define Java-threads inside of the static method or in this case it's better to use instance-based method? ...
1
vote
0answers
29 views

Sum of N primes in parallel-ish

I'm primarily a C# guy--day job, most of my hobby projects, etc. Linq's AsParallel() call would be my normal way of doing something like this, but--tragically!--Rust hasn't stolen that just yet... ...
3
votes
2answers
162 views

Multi threaded TCP server

I wrote this just for fun, to hone my exception handling skills. I want to know what I can do better in terms of exception handling (and otherwise) in the below code Server ...
6
votes
1answer
98 views

Task scheduler coding exercise

In an interview about multithreading I was asked to write code to satisfy the requirements below. In the exercise you need to provide implementation of single-threaded TaskScheduler class with the ...
1
vote
2answers
119 views

Producer Consumer in C# with multiple (parallel) consumers and no TPL Dataflow [closed]

I am trying to implement producer/consumer pattern with multiple or parallel consumers. I did an implementation but I would like to know how good it is. Can somebody do better? Can any of you spot ...
2
votes
2answers
122 views

Using a Java queue

I am developing a plugin for a system, the plugin catches some events in that system, wraps them and pushes out to another system for analysis. The overhead generated by the plugin must be as low as ...
1
vote
1answer
147 views

Saving a collection of WPF user control layout into an XPS document

I am making an application to save a layout of user control into an .xps document. But, the export doesn't seem completed if the data is too many. I've tried to encapsulate each part with ...
0
votes
2answers
44 views

Java background server class that might be called from ui thread

I have a server communicating over network interface. This server should run on a background thread, so that it does not block the ui thread. The ui thread starts and stops the server. Even starting ...
10
votes
2answers
121 views

Implementing JQuery style 'deferred' and 'promise' in C#

I like the pattern of the jQuery Deferred object. I like how you can call Resolve any number of times, but the listening objects will only be notified once. I also ...
4
votes
1answer
62 views

Streaming hacker news posts

Hacker News recently released an official API. Unfortunately, it cannot be used to get the newest posts submitted. I wrote a script to provide a faux streaming-api like method (like praw reddit's ...
5
votes
2answers
117 views

Thread-safe Phoenix Singleton class template with Boost

I've implemented the phoenix-singleton as a class template with boost inspired by Modern C++ Design. The code compiles fine with MSVC 2013 - and it seems to work, but I'm new to multi-threaded ...
6
votes
2answers
217 views

C# program that uses events

I am trying to learn C#. Please tell me if the following code respects coding standards and naming conventions because I want to write beautiful code. The purpose of this program was to help me ...