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)

1
vote
0answers
27 views

Threadsafe webapplication getParameter()

I am new to Web Applications and Thread Safety. Please, could somebody tell me if the following example is thread-safe? My main concern is that the AClient and ...
1
vote
1answer
41 views

Brute-force word cracking program using /dev/urandom

I've been having fun with this program and trying to use different methods and such to achieve the fastest possible word cracking program I can come up with. I'm pretty happy with my current program ...
0
votes
0answers
34 views

Optimizing LINQ routines

I run a build system. Datawise the simplified description would be that I have Configurations and each config has 0..n Builds. Now builds produce artifacts and some of these are stored on server. ...
5
votes
2answers
89 views

Downloading list of images

This code downloads a list of images, each in a different thread. I have some questions about this code: I don't know how to get information about correcting downloading (sometimes thread just ...
-3
votes
1answer
45 views

Simple Implementation of a BlockingQueue

An implementation of BlockingQueue ...
3
votes
1answer
28 views

MEF Execute Plugin Exports in Threads

I am developing a service application that would implement a peer to peer messaging system. I am wondering if my following code is the best approach. It works, but I am naive and it would be nice to ...
5
votes
2answers
113 views

Queue for distributing tasks between threads

I implemented the following class to dispatch std::function<void(void)> objects to a thread pool. Multiple threads will block on the pop call until a task is ...
10
votes
2answers
241 views

Chaining asynchronous tasks that must run sequentially

I want to implement an Agent-like object in C#. An Agent wraps some memory location (ideally storing an immutable object) and receives updates to that location. All ...
6
votes
1answer
53 views

A tiny module for handling text updates

I call these text updates "Feeds". A Feed object has some basic attributes like its content string, how many lives it has and its priority in the queue. I haven't ...
5
votes
2answers
57 views

Caching large object in multithreading environment

I'm having to dabble with caching and multithreading (thread per request), and I am an absolute beginner in that area, so any help would be appreciated. My project requirements are: Cache one ...
4
votes
2answers
72 views

Storing data into an SQL table using multiple threads and queues

I have a process running in a separate thread which reads data over Ethernet and raises an event for each read. Then, this data is processed over a tree of classes. At the top of my class tree, I want ...
8
votes
1answer
76 views

Thread safety/Transaction enforcer

I have some legacy classes written without thread safety in mind. Instances of these classes are now being accessed in a multithreaded context in a thread-un-safe manner. Cue chaos. To fix this I ...
6
votes
2answers
82 views

Multithreaded Network Server

I would like the following code reviewed: I am trying to create a local server which listens indefinitely and provides the latest information. The server runs another while loop which fetches ...
5
votes
0answers
42 views

Recursive shared_mutex implementation

I found myself in need of of a Readers-Writer mutex. With C++17 TR2 support not yet available in our compiler, I set out to implement std::shared_mutex so that we ...
3
votes
0answers
41 views

Dynamic voting protocol implementation for replicated file system

I recently implemented a dynamic voting protocol for a replicated filesystem. I would really appreciate it if you can review the design and some choices made with regards to sharing of Locks & ...
5
votes
1answer
118 views

C++11 recursive atomic spinlock

Could you please review my spinlock implementation? ...
0
votes
0answers
24 views

Parallel chunk uploading through HTTP requests

I am writing this class for parallel chunk level uploads to my local server. This reads the files in a given directory, uploads with n threads in parallel. Initially, sends a request and obtains a ...
3
votes
0answers
21 views

Project Euler #2 in Go

I just learned Go (yesterday in fact) and today I made this solution to Project Euler #2. The problem is to sum the even Fibonacci numbers. My program uses the matrix representation of the linear ...
2
votes
1answer
51 views

Concurrency Bank exercise with multiple accounts

I am doing an exercise in Java concurrency. The problem statement is as follows: Bank holds an array of Accounts. Client do (in a loop) the following operations: (1) work, then sleep for random ...
4
votes
0answers
59 views

Blocking reads when writes are happening on two flows

I am trying to implement lock by which I want to avoid reads from happening whenever I am doing a write. My requirements are: Reads block until all three maps have been set for the first time. Now ...
4
votes
1answer
44 views

Multithreaded scoreboard for different levels

For an assignment I had to create a highly multi-threaded scoreboard for a multi level game. So every time a user adds a score if the level doesn't exist, it gets created ad-hoc. Important point: a ...
1
vote
2answers
48 views

AsyncTask alternative with Runnable and CountdownLatch

What is wrong with this pattern which emulates AsyncTask functionality?: ...
7
votes
3answers
102 views

Parallel factorial algorithm using std::thread

This code calculates the factorial of a number on multiple threads. My issue: it is only a little bit faster than the sequential version of it (and I think I know why, I just can't find a way to solve ...
3
votes
1answer
98 views

Safely storing Azure Topic clients in concurreny dictionary

I am trying to optimize the usage of TopicClients in my app. The instance is originally covered by interface and passed by IoC, so the IoC will dispose it at the end of the program life cycle. This ...
7
votes
1answer
52 views

Python Socket Receiver

I put this together and am having some doubts to the number of connections I can make. I also doubt if I can brute force the server to serve up connections and then hang. Please take a look and tell ...
5
votes
1answer
166 views

Classic Snake game using Python, Tkinter, and threading

I have just installed Ubuntu and am re-familiarizing myself with Python. I learned the basics in late 2012-early 2013 and I'm practicing with it in order to get better at programming concepts and ...
5
votes
1answer
67 views

A Stream wrapper that executes all writes asynchronously

I wanted to make a Stream that can wrap another stream and buffer all writes, to increase performance; comparable to the ...
2
votes
1answer
61 views

Async processes in Java Spring

I need to refactor this class having in mind that the logic inside the call methods is not so short and it require spring dependencies to work, the base class I have is: ...
4
votes
1answer
83 views

Lock-free bounded stack atomics

I was thinking about using very basic bounded (preallocated) stack to keep track of my threads IDs in correct LIFO order. I was wondering if my implementation is thread safe: ...
10
votes
2answers
296 views

Memory cache implementation

I have created an open source memory cache called cachew and can be found here: cachew. I would like your help to make it better. Regarding the class Cache or its ...
3
votes
1answer
41 views

Implementation of FastICA in multithreading approach

I am to implement a parallel version of FastICA, so I implemented the serial version of FastICA. Now this is the architectural diagram of how it is going to parallelize. I just coded a basic ...
1
vote
2answers
45 views

Computing the correlation of an analyzed stock ticker

I have an enum of stock tickers, then from the database I get details for an analysed ticker (stock). In the loop, I compare the details of the analysed ticker to details of the rest of tickers, ...
7
votes
1answer
102 views

One producer multiple consumers

I want to code the following scenario: One Producer: produces n (n=100 here) objects m Consumers (m = 5 here): consumes k (k = 10 here) objects at a time in a round robin fashion; Consumer 1 first ...
1
vote
1answer
49 views

System to handle the short lived async task

I'm developing an application in which there are many short-lived tasks which are run in separate threads. I've developed a generic and reusable system to handle such a requirement. The code snippet ...
2
votes
1answer
43 views

File upload to web server using HttpRequestFutureTask

I am working on uploading files through Rest API. Tried my hand using single upload and works. I have modified to accommodate parallel uploads using Futures. Will there be any chance that this code ...
0
votes
1answer
37 views

Canvas in Tkinter app for Conway's Game of Life updates so slowly

This is Conway's Game of Life written in Python and using Tkinter for GUI. Problems are: The "Play" button works so slowly. I can see how the canvas is redrawing from top to bottom. But when I ...
4
votes
1answer
33 views

Adding hostname to block list after x consecutive failures in multithreading application

I am using Callable in my code which will be called by multiple threads as shown below. Given a user id in DataKey object, I will find out what are the ...
3
votes
2answers
110 views

Multi-threaded domain status checking in Java

I'm tinkering with the idea of crafting a search engine in my spare time. More of a learning experience than anything at this point, but still a project. A key aspect of this system is checking ...
4
votes
1answer
33 views

Monitoring and re-establishing a PostgreSQL connection

Within a complicated Ruby project, I need to monitor the connection to a PostgreSQL database, as answered here. I use a thread for this purpose. Every few milliseconds, I invoke "consume_input" which ...
2
votes
1answer
35 views

Running alarms in python

My code is designed to simply trigger alarms; it is not supposed to be used by anyone but me. ...
6
votes
1answer
109 views

Thread-safe memoizer

I have searched around but I was not able to find a complete implementation of the memoize pattern in a multithreaded context. It's the first time playing with thread synchronization. The code seems ...
4
votes
2answers
71 views

A Note class which plays a note and stops it after specific period of time

This code plays a note for a specific period of time using NAudio.dll 1.3.8. ...
3
votes
0answers
60 views

Refreshing customer list periodically in the background

I have a method RefreshCustomersInternal that refreshes customer data from a server and returns a Task. Since this process is ...
3
votes
2answers
88 views

Resource caching in Java with soft references

I'd like to cache some heavy resources locally. The goal of this implementation is to have be able to load resources for an unknown amount of time and then keep them in memory and finally evict them ...
10
votes
5answers
257 views

Word frequency in a large text file

I've am trying to read a large text file and output the distinct words in it along with it's count. I've tried a couple of attempts so far, and this is by far the fastest solution I have come up with. ...
2
votes
1answer
67 views

Custom Session Pool

We use a student information system called Colleague that is developed by Ellucian. As far as I can tell, the system does not use any sort of session pool so rapidly opening and closing connections ...
2
votes
1answer
58 views

ThreadPool based on ASIO, using a particle emitter

This code exists in my home repo and in general nobody else has really touched it. Living in such a vacuum has left me kind of uncertain of the actual code quality and correctness which is why I am ...
5
votes
1answer
71 views

MailQueue - follow up

Follow up of this question. Things altered: Put logging (debug level) for creating and starting thread. A separate thread for starting the different threads. Locking object and synchronise for ...
3
votes
0answers
125 views

Microsoft TPL DataFlow Thread Safety

From the MSDN site it mentions that all the public static members are thread safe. I have the below scenario and needed some advice I have a simple interface ...
4
votes
1answer
83 views

Implementing pthread barrier for Mac OS/X

I have written this little thingie to fix a problem of missing pthread_barrier_t in Mac OS/X pthreads. Are there any issues with this code? The header: ...