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)

2
votes
0answers
16 views

Synchronous events library

I have implemented a small library that handles synchronous events with posix compliant threads. I oriented me on the already existing posix thread API. Here are the files I created: ...
10
votes
3answers
665 views

Dining Philosophers Algorithm

Please visit the http://en.wikipedia.org/wiki/Dining_philosophers_problem for algorithm discussion. I have written below java program to solve this problem by Arbitrator solution algorithm mentioned ...
1
vote
1answer
56 views

Spreading the load more evenly from a background thread

I have a background thread which runs every 5 minutes. I am using ScheduledExecutorService for this. Every five minutes, I am making a call to one of my service and ...
0
votes
0answers
69 views
+50

Having full atomicity against all the threads without impacting performance or throughputs

I am working on a project in which I construct a URL with a valid hostname (but not a blocked hostname) and then execute that URL using RestTemplate from my main ...
3
votes
0answers
21 views

Loading gif form on a Windows console app using threads

I have a main form which does processing for an extended period of time. Normally, progress bars are used to show either the loading status or simply show the program is still running/hasn't freezed. ...
6
votes
3answers
244 views

Correct control of execution of Java thread

I'm writing an application that will use the JLayer library to play an mp3 file. Since the player does not have any methods to pause the playback - ...
-1
votes
0answers
8 views

I'm not able to perform LSI in R [closed]

This is the text I want to perform LSI on This text is “memoirs of Sherlock Holmes” Please download the text from http://www.gutenberg.org/cache/epub/834/pg834.txt My aim is too Apply LSI on the ...
-1
votes
1answer
41 views

Multithreading - program with lots of parallel routines (C++) [closed]

I'm coding a networking software, which has lots of functions (modules) which can be run in parallel. They share some resouces, like libnet_contexts of every type, ...
5
votes
1answer
48 views

ThreadSafeKeyedObservableCollection<TKey, TItem>

Is this a thread safe collection? Any issues with the code? ...
5
votes
0answers
61 views

How do I interrupt a ServerSocket#accept() and shut down a multi-threaded socket server?

I have got here a work-in-progress piece of code here that does multi threaded communication via sockets. I am using a poison pill to shut it down. It is a local port number. Is there a better way to ...
1
vote
0answers
10 views

Creating a “Produce and Consume” using Swingworkers

I am experimenting with the produce and consume concept while trying to incorporate it into my own project. I basically have two Workers in a small example I made: ...
3
votes
0answers
30 views

Parallelizing some model fitting code using multiprocessing

I'm trying to refactor some code for fitting parametric models that are defined symbolically using Theano. My goal is for all models to expose a common interface so that, as far as possible, they can ...
2
votes
1answer
50 views

Producer - Consumer interaction

I have an implementation of Producer-Consumer multi-threaded interaction.It works.But I feel that during the execution wait states happen too often between Consumer ...
4
votes
2answers
101 views

Lock-free multiple producer single consumer message queue

For a while now I've been after a lock-free, simple and scalable implementation of a multiple producer, single consumer queue for delegates in C#. I think I finally have it. I've run basic tests on it ...
7
votes
2answers
385 views

Generic cached value class mimicking Lazy<T>

Before I wrote this I searched and found a number of solutions that make use of a caching provider to handle a set of items. I felt that was too cumbersome of an approach and set out to create a class ...
0
votes
2answers
29 views

Which would be a more elegant way to make a thread wait?

I am writing a program that utilizes a third party API. I attach a handler to an object and wait for a message back. the responses from the server then get saved into an array list. Unfortunately it ...
4
votes
2answers
93 views

Flow Task Scheduler

Scenario: I wanted a task scheduler/doer that enables my application to schedule some tasks to be executed in a specified time but in the same order they were scheduled in or depending on their ...
5
votes
2answers
86 views

FileSystemWatcher with threaded FIFO processing

I have single threaded C# console application that uses FileSystemWatcher to watch folder for new files. My app sees a file being written, waits until it is ...
1
vote
6answers
115 views

Looping through an array of strings containing approximately 3 million lines of strings

I have a function that loops through an array of strings containing approximately 3 million lines of strings. My problem is this loop is running too slowly and I want to know how to make it faster. ...
2
votes
1answer
78 views

Efficient Multithreaded File Processessing in Java

This method in my code uses a producer-consumer design to read many files and process them for use in an NLP algorithm. The completion service collects files as they are processed, which means that ...
0
votes
0answers
50 views

Run a WCF server in a background thread on a console app

This app is a P2P client running on Windows using WCF.* I'm spawning the WCF service using Task<T>. The WCF service can be canceled using a ...
1
vote
2answers
60 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 ...
4
votes
1answer
44 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 ...
1
vote
1answer
63 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
74 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
53 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
74 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 ...
4
votes
1answer
86 views

Inefficient Stopwatch - revised

This is my revised code of Stopwatch: ...
4
votes
1answer
69 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 ...
5
votes
1answer
115 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
153 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
44 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
68 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 ...
4
votes
1answer
108 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
54 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
55 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
66 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
120 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 ...
3
votes
3answers
78 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
89 views

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

I'm developing a Windows Service 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
84 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
65 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
120 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
58 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
3k 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
130 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
259 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
83 views

Function object passing for a task scheduler

Here is my full implementation of a generic Functor-like class: ...
5
votes
1answer
264 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
82 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 ...