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
1answer
57 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
35 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
1answer
16 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 ...
3
votes
1answer
37 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
46 views

Streaming hacker news posts

EDIT: Thanks for the answer. I took suggestions from here and readings elsewhere and have completely refactored it, link. Hacker News recently released an official API. Unfortunately, it cannot be ...
5
votes
2answers
81 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 ...
5
votes
2answers
107 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 ...
2
votes
1answer
61 views

Multithreading pthread program

My multithreaded version of code works slowly than singlethreaded. Can you help me to understand why? ...
0
votes
0answers
14 views

wrote a code for race in java won't work [migrated]

Can anyone do a review of my code? I am new to Java. I tried to run it. It gave an Illegal Monitor State Exception Error in Race and RaceMain class. Thanks a lot if you read it. ...
6
votes
1answer
109 views
+50

Mutual Exclusion with Mutexes

After I wrote this question: Producer/Consumer programs, I realized that I had forgotten to write a version using mutexes. I have now written a Producer/Consumer problem solver using mutexes using ...
1
vote
1answer
47 views

Can I get around manually resuming a thread in this C++ thread class?

I have inherited a C++ Win32 thread class which roughly works like this. I am looking for ways to improve the design; specifically I am looking for a way to get rid of the spurious ...
5
votes
2answers
71 views

Generic Object Pool in C#

I have a limit of 100 sessions (each session held in an object). Many threads will be requesting sessions, and it is very possible that all 100 sessions could be in use at any time. I'm a Junior ...
13
votes
3answers
187 views

Producer/Consumer programs

I am studying mutual exclusion in college, and we just covered the producer/consumer problem. The class does not involve writing code, but I decided to implement a bounded buffer version of this ...
2
votes
2answers
58 views

Handling thread interruptions in a directory iterator

This code is code written on a whim to help $someindividual asking for such a thing on $somechatmedium; what is needed is a way, ...
6
votes
1answer
211 views

Efficiently using ZeroMQ sockets in Java

I am working on multithreading project and I am using ZeroMQ socket to send the data as a byte array. Below is my example which works fine. I'm opting for code review to see whether it can be improved ...
1
vote
2answers
84 views

Proper way to wait end of a service and singleton design

My code works fine and I would like to know if I chose the best strategy to implement my code, or if It can written better (more fast, more clear, best use of design pattern, etc). In my android ...
1
vote
0answers
23 views

Python Multiprocess Dictionary Selector [closed]

I am attempting to select devices via telnet based on a key I get from pinging the telnet device. Basically it selects to use only the devices with the given key. I am running into issues when a ...
0
votes
0answers
30 views

From multiprocess to multithreading [closed]

I recently joined a team responsible for the enhancement of an existing 5-year old program. It was developed with multithreading in mind, but not correctly implemented. The solution is composed of ...
4
votes
2answers
46 views

Threaded generalised transform

I'm writing an application which works with huge amounts of sequential data, and often found the need to use std::transform. I see two potential improvements to ...
2
votes
2answers
131 views

Producer/Consumer Program

I am a semi-new Java programmer that tends to be a perfectionist. What I'd like to know about my code: How it compares to common practice. Is it readable? Are my comments appropriate? Any ...
5
votes
1answer
56 views

General Batched Job Runner

This question is inspired by: Generic Task Scheduler where the problem is to run tasks on a scheduled basis, in parallel, and have individual timeouts for each job. For example, consider this ...
2
votes
1answer
43 views

Precognitive waiting - waiting for something to finish, before it starts

I have implemented a class that has a method to wait until "something else" has happened. When this has happened, the current thread stops waiting and returns from the method. This is my current code: ...
3
votes
1answer
32 views

Syncing e-mails for multiple accounts

I wrote an email syncing program in my ASP.NET MVC website that syncs e-mails from multiple e-mail accounts to my database. Each e-mail account has to be independent from other accounts and they have ...
1
vote
0answers
64 views

Generic Java Task Scheduler (Followup) [closed]

As a followup to my previous question, and after receiving a great answer, here is the updated Scheduler class. I would also like to state some goals & ...
7
votes
1answer
100 views

Generic Java Task Scheduler

I wrote this generic task scheduler for executing tasks in fixed-delay intervals, can you find anything wrong with it, or issues that may arise from using it for sending something like queued mails in ...
4
votes
2answers
78 views

Managing FutureTask and ExecutorService

I have many unrelated tasks to execute and I have to get the result of the task so I use the FutureTask. I submit all the task to the thread pool and use a map to ...
4
votes
2answers
157 views

Concurrent activity on ArrayList

I have an immutable Point class and a CollectionPoint class which manages instances of my ...
1
vote
2answers
87 views

Logger facade code for configuring multiple loggers are runtime

Following is the code for a logger facade that I have created, which can be used to log via any of the standard and configurable loggers like log4net, BitFactory, currently I have just integrated ...
5
votes
0answers
55 views

Multithreading in a 2D Mining Game

I have implemented some basic multithreading in my 2D mining game that I asked about in a previous question. The first part is working out great (creating the initial object instances in the ...
1
vote
2answers
82 views

Thread, handler and activity structure for a bouncing ball animation

This is a custom MyActivity class with two custom views (bar and a ball): ...
6
votes
4answers
122 views

Efficient prime factorization for large numbers

I've been working on a little problem where I need to compute 18-digit numbers into their respective prime factorization. Everything compiles and it runs just fine, considering that it actually works, ...
2
votes
1answer
75 views

Lockless, blocking, non synchronized multiple producers and consumers ring buffer

My program is structured like this: there are M producer threads, each of which computes a section of an object O with index ...
1
vote
1answer
81 views

Monitoring progress in Parallel.ForEach every minute

I'm using Parallel.ForEach to download 500K URLs and I want to monitor the number of URLs that have been successfully downloaded each minute. ...
6
votes
2answers
87 views

An extension method to safely retrieve or add a dictionary value

The extension method: ...
1
vote
2answers
125 views

Queue with task parallel library

I am new to programming using the .Net TPL Framework and multi-threading in general. I have googled up some tutorials and articles and put together the solution below. It is a simple multithreaded ...
1
vote
1answer
62 views

Crawl multiple pages at once

This an update to my last question. I want to process multiple pages at once pulling URLs from tier_list in the crawl_web ...
4
votes
1answer
43 views

Threading and queue experiment

I'm just beginning to get the idea of queue and threading. I would welcome input on this exercise script: ...
1
vote
1answer
39 views

Multithreading synchronization between reading and writing in a channel

I was hoping to get some feedback on what the recommended design pattern are for this subject. ...
1
vote
1answer
54 views

Reading a property on a main thread that is set on a background thread

I am currently handling some setup of an object on a background thread (I am using a concurrent queue within the following initWithDocumentFileURL method): ...
1
vote
2answers
82 views

Multi Threaded Report Generation

I have a requirement where i have to generate some report basically read from db and write data to Excel. I want your help in reviewing following things in my code. Data Base Connection Multi ...
2
votes
1answer
51 views

Show a ProgressDialog and send an SMS in the background

I have written a procedure that shows a ProgressDialog sends an SMS updates the View from another thread hides the ...
10
votes
4answers
431 views

Multithreaded HiLo game

For my CS class I have to write a HiLo game using multithreading. I am brand new to multithreading and not sure how to best implement it. The program below works, but I am wondering if there is a ...
3
votes
1answer
59 views

Python Threading

I have the code below that I am using to thread certain tasks. Basically, you pass in a function reference, a list of data and the number of threads. It will run the function for each item in the list ...
0
votes
1answer
25 views

ConnectionPool using LinkedBlockingDeque

Below is the code snippet that I developed for ConnectionPool. Kindly let me know if there are any problems or shortcomings with the below code. I've deployed it to our test environment and was able ...
7
votes
2answers
156 views

SQL service broker and threading

Basically my code waits for database table a to have an XML string inserted into it. The SQL query parses the XML string and stores it into separate columns (this ...
4
votes
1answer
44 views

Optimization of Barnes-Hut Multithread Insertion algorithm

I'm currently working on optimizing a Barnes-Hut implementation (connected to a previous post I did) and I need help to optimize it further. After some testing, the main problem appears to be in the ...
1
vote
1answer
36 views

Decoding an element list

I have a function which I am calling an infinite number of times (or until a condition is met). The problem with this recursive function is that on a higher level, it is called by a worker thread ...
3
votes
2answers
195 views

Multithreading decouple update-logic and render-logic

I want to improve my multithreading competence and tried to build a compact doublebuffered way to separate two threads where one is only displaying the state and the other one updates the state. So I ...
2
votes
1answer
60 views

Taskqueue multithreading

I have a synchronized list that I use as a taskqueue. In this queue I have some long values that need to be proceed and create heavy I/O and delay. I thought of using threads to get things done ...
0
votes
1answer
79 views

Handle concurrent HTTP requests with a generic .ashx

I have created a .ashx file that is able to handle concurrent http requests. Works great, but now I'd like to create a base class that does the common work in order to not repeat myself each time I ...