Multithreading 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)

1
vote
2answers
44 views

SynchronizedArrayList implemented using reader writer synchronization

I am trying to understand the workings of reader writer locks. For the sake of learning, I implemented reader writer synchronization by my own. I implemented ...
0
votes
0answers
20 views

Swing client rests on Netty for I/O — how do I send/receive from the GUI? [migrated]

For right now, the client instantiates the Swing GUI. This seems to work, to a degree. What's the correct flow to allow messages to get passed to, and received from, the GUI? client code: ...
4
votes
1answer
31 views

Filewatcher compiler for watching different files

I'm trying to create a filewatcher program that can watch different files. The files might have subfiles that are being imported into the main file, which is being represented by the file object. I'm ...
0
votes
0answers
19 views

Producer consumer problem consuming data using transferFrom, Java [on hold]

I have a producer consumer problem where multiple threads download a segment of file and write it into buffer these buffers along with location in file where the will be written are passed into a ...
1
vote
1answer
43 views

Async function with slow web reference(web service) slowing down webpage

Is there a way to make a threading/async post with a web reference not slow down the whole website just because the web reference takes a long time to return a response? I have a send email function ...
5
votes
2answers
55 views

Queue that connects multiple producers and multiple consumers

The scenario is about processing 'Message' objects. Producer creates them and Consumer does the consumption. ...
0
votes
0answers
36 views

Command line multipart file downloader using requests

The code below downloads file in multiple chunks if split is set to some number, however there is a limit to maximum possible splits defined below by maxSplits if ...
4
votes
2answers
59 views

Accessing a String value from multiple threads without synchronization

I'm looking for some input here. I have a class that contains a value which is updated every few seconds by a method within that class. Right now, access to this value across multiple threads is ...
2
votes
0answers
42 views

Inefficient Stopwatch - revised

This is my revised code of Stopwatch: ...
4
votes
1answer
63 views

Simple way to prevent duplicate logging of errors

I've been tasked with updating our current error logging system to prevent the logging of similar errors (from a single client program) that were probably caused by the same event. The code here is ...
4
votes
1answer
104 views

Inefficient Stopwatch

I have just finished a simple GUI stopwatch, but some of its code looks like it needs replacing. This is the code: Clock class (extends Thread): ...
7
votes
2answers
127 views

Displaying a scrolling stock exchange ticker in a window

I've written my first OOP program (194 lines including docstring and comments) in Python that uses Tkinter as GUI and Threads. The program shows a window and displays a scrolling stock exchange ...
2
votes
1answer
41 views

Implementation involving POSIX, semaphores, and locks

I am trying to get over my fear of multithreading programming and teaching myself to code using POSIX. I wrote a small version of the consumer producer problem. I am hoping I can get some feedback if ...
0
votes
1answer
66 views

Command line multipart or single file downloader

I am looking for a code review for this multipart or single file chunk downloader using threading and queues. downloader.py ...
3
votes
1answer
83 views

Maintaining a car collection list in a multithreaded application

I have a multithreaded application for web scraping from an automobile website. While performing web scraping, there are many links that gives the same result, so I have to check for data redundancy. ...
1
vote
1answer
43 views

Concept for saving context information

My Problem I have a library containing business logic which is being used from 3 different projects: Website Local WPF Application WCF Service The library uses Entity Framework and a connection ...
1
vote
1answer
51 views

Will this act like a ThreadPool? [closed]

I know that until the n threads will not complete their jobs, the new jobs will not be assigned, but will this code be thread-safe and execute ...
1
vote
1answer
56 views

Split download file buffer by any number of threads

This is my first attempt at splitting the download buffer into several threads by the number provided. I want to improve on performance and better implementation approach. ...
6
votes
1answer
107 views

Simple chat console app

I wanted to practice using sockets and multithreading. This is simple code where I start a Server and connect to it via Client ...
2
votes
1answer
39 views

PPL and AMP performing worse than sequential transform

I wrote the following short test code to test the performance of C++AMP and the PPL libraries against the sequential STL implementation of std::transform. To my ...
3
votes
3answers
77 views

Threadsafe get method on queue that draws values from other queues?

I have a class that implements Queue and draws values from other queues which may still be referenced outwith it. I want my method to draw values from the contained queues, using synchronized locks on ...
2
votes
1answer
67 views

Usage of Interlocked.CompareExchange for deciding whether a property has been changed by another thread

I'm developing a Windows Servise that receives data from somewhere and saves it to DB one time per 5 minutes. The Service is multithreaded and I actually got problems when several threads saved data ...
5
votes
1answer
74 views

Consumer-Producer Problem: POSIX Thread

I have implemented a producer consumer problem, following the resources below: Oracle doc CSEE I have used mutex_t and ...
3
votes
1answer
48 views

Uploading a video in S3 Using Future

I've posted a similar program previously, but I have not made any major modifications in the code, so I am posting it again by deleting the previous question. I am afraid of the thread keyword and I ...
0
votes
2answers
84 views

Python UDP-server and JSON parser script

I am a python beginner. I wrote a script which should run on a raspberry PI as an UDP server. It is reading and writing to a serial device and has to process and forward JSON strings too. Because ...
2
votes
1answer
48 views

Cross Thread Access to Object in ViewModel

This is a fairly straight forward question. I have a C# WPF MVVM application that call a C++ DLL to do some compilation/crunching. To update the UI C# application for progress updates I am using ...
22
votes
3answers
2k views

What are the best practices with multithreading in C#?

For a while I have been interested in seeing if some tasks work well when split across multiple threads. On the one project I have been busy with I have been creating a lot of small utility apps, to ...
4
votes
1answer
110 views

Platform independant thread pool v4

This is a continuation of this question. Following the previous advise, the thread pool now can handle almost all types of input, except for one key form, where the function/functor requires one of ...
4
votes
2answers
243 views

Creating a cache manager

I am purely new to C++ memory management. Am I on the right path, or should I employ a different design strategy or a different memory manager policy (such as ...
4
votes
2answers
71 views

Function object passing for a task scheduler

Here is my full implementation of a generic Functor-like class: ...
5
votes
1answer
242 views

Multithreaded file downloader using threading and signals

This is my first attempt to write a multithreaded application that downloads files from internet. I am looking for improvement in code, logic and better strategy for implementation. Please ignore the ...
3
votes
2answers
68 views

Platform independant thread pool v2

This is a continuation of this question, v3 can be found here Taking into account the advise given by Loki, an implementation of the threadpool using a ...
8
votes
1answer
95 views

Platform independant thread pool

v2 of this question is here and v3 is here To get a better understanding of C++11/C++14, I thought I would develop a thread pool, even if it has been done to death! The only dependency outside of ...
9
votes
1answer
185 views

Thread-Safe Integer Sequence

I would like to give an Integer to whatever demands it. For that I use the following code ...
1
vote
0answers
37 views

Mutualising multi-threaded calls to EJB from Servlet

I have a Servlet that makes an EJB call to a backing server which takes about a second to return some data that changes reasonably regularly. I can't cache the data on the Servlet-side, so I have ...
6
votes
2answers
627 views

A simple semaphore in Java

It is a simple semaphore in Java. Although it passes all their tests with flying colors, I'm still not sure it's correct. For example, the last thing I wasn't sure about was ...
1
vote
0answers
37 views

Moonshot & `Thread.Abort` - dealing with the fallout

Recently, I encountered an anomaly in the manner by which a worker thread was terminated. It prompted me to do some searching and I realized that I was constructing thread code in a haphazard manner. ...
4
votes
2answers
136 views

Concurrent blocking Tasks in a BackgroundWorker

I'm using a StaTaskScheduler (TPL extension) to open some web browser windows simultaneously and navigate to different sites (using WaitN, but it might as well just be a ...
5
votes
1answer
63 views

Scalability of C server implementation based on pthreads

I am wondering about the feasibility of the following basic implementation of a server and how well it would scale. I know that large-scale, distributed servers should probably be written in a ...
6
votes
4answers
89 views

Calculation of e performance issue

Can you give me some idea how to optimize the switch statements, maybe a for or do while ...
1
vote
1answer
114 views

Thread-safe callback registration and invocation in C++11

I need your help in reviewing the following code. My main concern is dead-lock, but there might also be other issues. The EventGenerator object is owned by a ...
2
votes
1answer
35 views

Proxy using socket, doubts on multithreading and connection closing

I'm trying to make a simple proxy server in Python using the socket library, mostly to understand how it works. I'm a noob both at programming and networking, so please be nice if my questions are ...
3
votes
0answers
99 views

Concurrent queue

I recently wrote a concurrent, mutex-less (but not lockfree) queue and wanted to know if it is actually correct, and if there are any particular improvements I could make: ...
9
votes
2answers
372 views

Using synchronized blocks and volatile variables to ask a Java thread to terminate gracefully

Edit: Just to clarify, this isn't my original code, I've simplified it to make it smaller/easier to understand what I'm trying to do. It's my first time working with threads in Java, and I was ...
3
votes
2answers
206 views

Slow data-processing and inefficient memory usage in .NET containers

I am writing a text classifier and in order to do so I need TF/IDF values per every word of my signle text. Then I need to use the cosine similarity: \$similarity = cos(\theta) = \dfrac{A \cdot ...
9
votes
1answer
129 views

My first multi threading class

I've thrown everything I can at this, and I can't get it to lock or crash. My hope is that I have applied the principles correctly. I write client apps in JavaScript, and this is only the 3rd .NET ...
2
votes
1answer
84 views

Threaded pipeline

I have a threaded pipeline with single producers and (possible) multiple consumers. A producer might wait or not, depending on the policy provided. A problem here is valgrind (helgrind) is reporting a ...
4
votes
5answers
537 views

Circular queue implementation

Implemented simple thread safe circular queue. Looking for code review, optimizations and best practices. ...
1
vote
1answer
118 views

Multi threading in ASP.Net to increase performance of processing data from entity framework using anonymous types

Intro I am trying to populate a Multi-column Combo-box with a large amount of records.Depending on the selection the user has taken there can be 1 - 50000 items in the Combo-box (I may not display ...
7
votes
2answers
138 views

Optimize a parallelized program to optimize train schedules

This loops through a vector of vector of A and adds a smaller array to a bigger one at a specified position+random shift. Then it is checked if it is a better solution, and if yes, it is stored, else ...