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
1answer
34 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: ...
2
votes
0answers
18 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
35 views

Generic Java Task Scheduler (Followup) [on hold]

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 & ...
6
votes
1answer
63 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
52 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
143 views

Concurrent activity on ArrayList

I have an immutable Point class and a CollectionPoint class which manages instances of my ...
1
vote
2answers
59 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
40 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
68 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
89 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
56 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
53 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
63 views

An extension method to safely retrieve or add a dictionary value

The extension method: ...
1
vote
2answers
68 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
42 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
41 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
34 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
52 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
65 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
47 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
376 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
54 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
22 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
122 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
41 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
33 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
141 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
45 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
48 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 ...
10
votes
4answers
283 views

Ugly optimized caching of SimpleDateFormat

Concerning the optimization of this simple function String formatDate(String format, Locale locale, Date date) {...} formatting a ...
2
votes
2answers
153 views

How to efficiently use RestTemplate with HttpComponentsClientHttpRequestFactory in multithreaded environment?

I am working on a project in which I need to make a HTTP URL call to my server which is running Restful Service which returns back the response as a JSON String. I ...
5
votes
1answer
136 views

General multithreaded file processing

I'm trying to write a general multithreaded file processing facility. The idea is that some input file consists of a number of discrete records, each record needs to be processed in the same manner, ...
4
votes
1answer
132 views

Creating Thread safe list using Lock object

Will this code qualify for a truly thread safe list? It is using the Lock object. ...
1
vote
1answer
89 views

Creating Thread Safe or Concurrent List [closed]

Can a thread safe or concurrent list be created using the code mentioned underneath, where I wrap all the calls to the base class in a ReaderWriter lock. I can similarly implement all the public ...
2
votes
0answers
25 views

POSIX: Synchronous event 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: ...
3
votes
0answers
51 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
1k 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
70 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 ...
7
votes
3answers
254 views

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
1answer
108 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
264 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
1answer
51 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
50 views

ThreadSafeKeyedObservableCollection<TKey, TItem>

Is this a thread safe collection? Any issues with the code? ...
6
votes
1answer
202 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
31 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
45 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
61 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
186 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
409 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
42 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 ...