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
1answer
27 views

Thread-safe access to multiple objects [on hold]

I have two thread-safe collection in which one's item is other collection's key. Whenever a new Foo comes in, it will be both added to list and map. To ensure thread-safety, both operations are ...
2
votes
0answers
17 views

Memcached load generation

I have this code in python 2.7, it is working but right now it is not giving me the throughput that I want. The main function has the load generation loop (where it is putting work in Queue). I am ...
1
vote
1answer
45 views

Performance issue in generic sql utility

I recently working in .Net field and under circumstances had to write a program to execute sql from external source file.I have written the code and works fine but when it goes to Production server,It ...
3
votes
0answers
16 views

Fetch data from co-processor on network in background

My code communicates with a Raspberry Pi (with a static IP address) running on a network. The client sends a signal to the Pi, and the Pi sends back a double (encoded as a string) with the angle ...
7
votes
1answer
94 views

Lock-free multi-producer multi-consumer queue

I'm looking for some feedback on my lock-free queue, based on Disruptor, mainly for any potential concurrency issues, such as where I need additional fences. It looks correct to me, and I can't seem ...
3
votes
0answers
19 views

Run tasks in parallel using limited number of threads

To learn about concurrency in Clojure, I wrote a function that accomplishes the following: Takes a (possibly lazy or infinite) sequence of functions representing tasks to be run asynchronously Runs ...
3
votes
1answer
70 views

Initialize and sum an array in Java using threads

This bit of code initializes an array of any given size where each index corresponds to a thread and a value. That is, index 0 has 0, index 1 has 1, and so on. Then, the values, 0 to n, in the indexes ...
3
votes
0answers
30 views

Producer-consumer with a twist (consumer is a reader) in C++

Executive summary The twist is that the consumers do not consume, they just read. The producer makes items continuously in one of two alternating slots. Readers read from the other slot. When ...
-1
votes
1answer
24 views
0
votes
1answer
38 views

Long running in-process Publish/Subscribe class

I have a Pub/Sub class that will call Notify() when published and that Notify() could take around 10 seconds, so I need to make ...
3
votes
2answers
93 views

How to check a static class and its members are thread safe or not?

I'm new to parallel programming concepts. I'm trying to implement fire-and-forgot kind of method in my project. Somebody please evaluate the below code & let me whether this is thread safe or not. ...
-2
votes
0answers
30 views

Make the method thread safe in C# [closed]

Hello i have a method which is not thread safe. The method is: ...
4
votes
1answer
43 views

Java NIO server Selector loop

I have a server that uses Java NIO in non-blocking mode. Right now I'm using a single thread for the selector, and four worker threads to process the bytes after ...
4
votes
2answers
157 views

Multiprocess, multithreaded read write on a single file

I've got a job to create a library that would be able to support multithreaded and multi process read and write to a single file. On that single file we would store C# models in an array in JSON ...
0
votes
0answers
10 views

Improving the performance of web scraper using BeautifulSoup

I am using python3 with Beautiful Soup to scrape web site, I also used Thread to download images, but it will spend more than 30 minutes to get all information and download relevant images, how can I ...
0
votes
1answer
32 views

Custom concurrent stack implementation in Java

I don't want to use synchronized for sizeof method, any suggestion to implement the method thread safe? ...
3
votes
1answer
38 views

Thread pool using boost::thread

I would like to make a portable thread pool using boost::thread. Some one could tell me to look at boost::thread_group and ...
6
votes
1answer
74 views

Can my cache be more thread safe?

I have been working on a cache that can handle multiple reads at the same time, but the write is blocking. Is this code overkill by using both a ConcurrentHashMap ...
2
votes
0answers
17 views

Adaptive scan of function concurrently

This function try to scan the given function in n dimensions in the given range by adaptively divide the area into n+1 points polygon (e.g. triangle in 2D; tetrahedron in 3D) I tried to seperate the ...
0
votes
1answer
33 views

Loading message with Pthreads

I want to print a nice loading message with these three fading dots, while the main thread does some heavy IO stuff. This is why I implemented this: ...
2
votes
0answers
51 views

Blocking Memory Queue

This is a FIFO blocking memory queue in F# to be used as a component in a logging library. ...
4
votes
0answers
183 views

Cooperative multi-tasking / coroutine implementation

Here is my implementation of user-level cooperative threads in C++14, which I'm working on for a hobby project. It's not entirely finished but works pretty well so far. The target operating system is ...
2
votes
0answers
45 views

Parallel merge sort in Java

I have rolled my own parallel merge sort. My performance figures are as follows: Seed: 1457521330571 java.util.Arrays.sort() in 6840 ms. Sorted: true java.util.Arrays.parallelSort() 3777 ms. ...
4
votes
2answers
65 views

Terminal Chat Room

Summary I have written a pair of Perl scripts that form a UDP chat room allowing users to send messages over the internet with RSA encryption, making the messages imune to MITM attacks. The scripts ...
3
votes
0answers
37 views

Task scheduler with dependencies

I have need for a task scheduler determined by a directed graph. The tasks are held in a std::vector<task_type>, while the dependency graph is held in a ...
4
votes
1answer
66 views

Simple worker class

I just wrote a basic worker class for this person http://stackoverflow.com/questions/35827459/assigning-a-new-task-to-a-thread-after-the-thread-completes-in-c and I wanted to ask if the code has ...
5
votes
1answer
64 views

Simple Multi-Threaded Web Server

Need a way to test a web crawler. Threw together this web server that will replay previously saved pages from a real web server. Headers ...
3
votes
2answers
45 views

Parallel integer Quicksort in Java

Now I have that parallel Quicksort for (primitive) integer arrays. ParallelIntQuicksort.java: ...
3
votes
2answers
68 views

MultiThreaded TCP Server with high CPU usage

I wrote simple C# TCP Server application and my program use a lot of cup, i was wondering anyone can review my code and would be grateful for any hints and suggestion. This is my code. ...
5
votes
1answer
31 views

Parallel extension enchancement

As suggested in comments here I created a new topic for next version. I edited a bit original code, added exception processing and optimization, that first N = 1/core count tasks are processed on main ...
3
votes
1answer
51 views

Multiplying square matrix with C pthreads (POSIX threads)

I'm a student, and I'm trying to make the product of two square matrix with some threads in the soup. I've already worked on some fast single-threaded product (with some cache-friendly tricks), and ...
1
vote
1answer
49 views

Multithreading extensions

I created a following class to manage multithreading without extra overhead, which exist when I use Parallel TPL class. It is also useful for systems without ...
3
votes
2answers
74 views

Parsing HTML from multiple webpages simultaneously

My friend wrote a scraper in Go that takes the results from a house listing webpage and finds listings for houses that he's interested in. The initial search returns listings, they are filtered by ...
4
votes
1answer
67 views

Downloading files using Python-requests

I wrote a Python script to download files using multiple (source) IP addresses -- kindly suggest any improvements. ...
12
votes
3answers
4k views

Replacing Skype, reinventing the chat client

I'm creating a chat client and chat server after a several month programming hiatus. The goal is to make one with features I want but it's also a learning project. Although it's mostly because I'm ...
2
votes
1answer
52 views

Controlling parallel jobs with condition_variable

I'm trying to set up a system where I can have an arbitrary number of parallel tasks, all of which wait for a go signal, do their work, and then stop while a ...
1
vote
0answers
77 views
1
vote
1answer
82 views

Implementing the Actor-Model in C#

After learning the basics (isolated state, communication and computation) of the the Actor-Model, I wrote my own implementation and I'm ready for a thorough code review. You will be able to see that ...
1
vote
1answer
47 views

Limiting the amount of Calls to a Server

I have a server side operation which takes a percentage value from 0 - 100. The user controls this percentage using a SeekBar on the android client. Time-wise the ...
1
vote
1answer
78 views

Executor Service with Blocking Queue

I did not find a single working implementation of using an Executor Service with a Blocking Queue. So , I have come with with a working sample. Thoughts? ...
4
votes
1answer
54 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
82 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
36 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
2answers
60 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
166 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
175 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
112 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 ...
1
vote
1answer
66 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
125 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
167 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 ...