multithreading

How can I implement a multi-threaded PID controller in Java?

I'm kinda new to Java, so haven't yet fully grasped the concept of multithreading.I would like to create a PIDController class that allows me to do this: ControllerMethods methods = new ControllerMethods() { public long getError(long setpoint) { ...

AsyncTask and Android threading: how to get it right ?

I am firing off an AsyncTask to fetch images via HttpClient. Via DDMS in eclipse, the view shows that the AsyncTask runs and then hangs around. This is a screenshot of the DDMS threads view. Should the AsyncTask #1 thread disappear or is it benign ? What does the status wait mean anyway ? ...

Async calls from methods already running in threadpool

Hi, I am sorry for the title but I really do not know how to better describe it. I am using threadpool for processing incoming data on the server side and in one method I would need to call static method asynchronously but I am not sure how to do that. When server receives the data from client, it uses threadpool: System.Threading.Thre...

How to check whether thread management initialization finished?

I am developing a class, which can be instantiated before main() is called. I have a critical sections protected by a mutex is the code. Unfortunately, the application fails on AIX as the code is called before threads are initialized. I want to add a check to the code to avoid mutex locking if threads are not ready and use the locking af...

Handling events for specific Form

In my application, each thread handle a Form, and its events shall executed within the thread handling the Form. Is there a way to handle events for a specific System.Windows.Form instance? Application.Run doesn't fit my design, and Application.DoEvents process events for each Form instantiated by the application. ...

Threading with .NET and OpenCV?

...

OpenCV Multi-thread call

I have made a program that has two threads, soon to be three, that is trying to get an image from a web cam from both threads at the same time. Is there a way to do this or is there a better way to do this? (using openCV 1.1) ...

How to design a system that queues requests & processes them in batches ?

I have at my disposal a REST service that accepts a JSON array of image urls, and will return scaled thumbnails. Problem I want to batch up image URLs sent by concurrent clients before calling the REST service. Obviously if I receive 1 image, I should wait a moment in case other images trickle in. I've settled on a batch of 5 images. ...

Asynchrony and .NET events?

I'm really embarrassed to ask such a trivial question but debugging some software now convinced me I don't really understand this issue: How does .NET events work seen from an altitude of 20,000 feet? I don't mean the delegate/event handler pattern and all this. What I mean is - what's the BIG picture: Code A is doing something. Some ...

Handle InvalidItemStateException in jackrabbit

We are now experiencing a number of InvalidItemStateException in our web application caused by 2 or more users updating the same content. As far as I understood it is in design of JackRabbit to throw javax.jcr.InvalidItemStateException in such situation and that's ok, but I wanted to ask about the common way to handle that. We are fairly...

AMD multi-core programming

I want to start to write applications(C++) that will utilize the additional cores to execute portions of the code that have a need to perform lots of calculations and whose computations are independent of each other. I have the following processor : x64 Family 15 Model 104 Stepping 2 Authentic AMD ~1900 Mhz running on Windows Vista Home...

singletons and threads

My question is about threads being queued. For my example I have one Spring context. I have a method named CalculateTax in a stateless class. A request comes in, a thread is created (tA) and it eventually enters the CalculateTax method. Within the same "time frame" another request comes in and another thread is created (tB). Now, here is...

Resuming suspended thread in Delphi 2010?

TThread's resume method is deprecated in D2010. So, I thought it should now work like this: TMyThread = class (TThread) protected Execute; override; public constructor Create; end; ... TMyThread.Create; begin inherited Create (True); ... Start; end; Unfortunately I get an exception "Cannot call start on a running or supsen...

Specialist or generalist threads

Specialist or generalist threads. Hi, I'm working on a system where objects go through some steps. 1st. Mostly database queries 2nd. Mostly hd I/O and xml parsing 3rd. Mostly Webservice communication 4th. Mostly Xml serialization and deserialization 5th. Some optional work The system need to work with some thousands of objects p...

Multithreading using C on PIC18

How does one create threads that run in parallel while programming PIC18, since there is no OS? ...

GUI + multithreading support + regex support. Which language? JAVA / Python / Ruby ??

I'm interested in learning a programming language with support for GUI, multithreading and easy test manipulation (support for regex). Mainly on Windows but preferably cross-platform. What does the Stack Overflow community suggest? ...

Problem in javax.swing.SwingWorker

I have made a swings application but there is one problem in that which is as follow: I have initiated a SwingWorker thread named "Thread-Main" from the Event Dispatch Thread and have passed a JLabel reference of the GUI to the "Thread-Main". Now I have started 10 threads from the "Thread-Main". Now I want that all the 10 threads shou...

Java Double Checked Locking

Hi All, I happened upon an article recently discussing the double checked locking pattern in Java and it's pitfalls and now I'm wondering if a variant of that pattern that I've been using for years now is subject to any issues. I've looked at many posts and articles on the subject and understand the potential issues with getting a re...

Processing huge text files

Problem: I've a huge raw text file (assume of 3gig), I need to go through each word in the file and find out that a word appears how many times in the file. My Proposed Solution: Split the huge file into multiple files and each splitted file will have words in a sorted manner. For example, all the words starting with "a" will be stored ...

Java-like thread synchronization in C#

Hello, I am a Java programmer and I know a few things about threading int Java. In Java I can lock a method by using synchronized keyword: private int a; private int b; private int c; private synchronized void changeVars() { a = 4; b = 2; c = a+b; } I searched in msdn and saw that there are a few toys in c# to play with threa...