multithreading

Implementation of a work stealing queue in C/C++?

I'm looking for a proper implementation of a work stealing queue in C/CPP. I've looked around Google but haven't found anything useful. Perhaps someone is familiar with a good open-source implementation? (I prefer not to implement the pseudo-code taken from the original academic papers). ...

What .net mechanism should be used to communicate between a web service and an http handler?

The scenario is as follows: a device (not a PC) makes an HTTP request to a server and passes in identifying information in the http headers. The http handler on the server receives the request and keeps it open (implementing a long poll type mechanism). At some point, a user running a desktop app invokes some UI that causes information t...

Kill child process from main app

I have a Delphi server that run python scripts in the background (they run similar to "python Sync.py **params**"). This scripts can do things like connect to external servers, open ssh connections and scary stuff where they can hang. I need to detect if they hang, and kill it. Also, if the server is closed, and want to kill the proces...

Waiting for a thread to finish from a 3rd party library (OpenMap/Java)?

Hi everyone, My application currently has an interesting problem. This problem is with OpenMap but could probably be applied to any 3rd party library. In this particular example, our code needs to create our OpenMap tool and load its layers (in the background) and take a screenshot of a particular point of interest. However, the probl...

performSelectorInBackground, notify other viewcontroller when done.

Hi, I have a method used to save an image when the user clicks Save. I use performSelectorInBackground to save the image, the viewcontroller is popped and the previous viewcontroller is shown. I want the table (on the previousUIViewController) to reload its data when the imagesaving is done. How can I do this? The save method is call...

Why is UITableView not reloading (even on the main thread)?

I have two programs that basically do the same thing. They read an XML feed and parse the elements. The design of both programs is to use an asynchronous NSURLConnection to get the data then to spawn a new thread to handle the parsing. As batches of 5 items are parsed it calls back to the main thread to reload the UITableView. My is...

Django/Python: How do you start a new process in Python?

After a customer uploads an image I want to re-size an image to 8 different sizes and then send them up to S3 and save them to the file system. Obviously this could take a long time (seconds) and I would want to do it in a "multithreaded" way (I quote that because I don't care if it's actually multithreaded or if it's some other function...

Python/Django: Can a process keep running after the user sees the "Thanks. You're done!" page.

I'm trying to understand threading better. If I create a program that allows people to upload a photo and then I create a new process to resize the image in a hundred ways (taking 5 seconds or longer), and the main program returns a response HTML page to the user saying "Thanks. You're done!", can the other process still be working at th...

what are threads in actionscript functions?

I've seen a lot of other developers refer to threads in ActionScript functions. As a newbie I have no idea what they are referring to so: What is a thread in this sense? How would I run more than one thread at a time? How do I ensure that I am only running one thread at a time? Thanks ~mike ...

Updating an ObservableCollection in a separate thread

In a WPF application an ObservableCollection is filled and updated by LINQ to SQL queries. Then UI objects are updated using values from this ObservableCollection. Is it possible and reasonable that operations of updating this ObservableCollection by LINQ to SQL queries were executed in a separate thread? If yes, will, in this case, i...

QObject (QPlainTextEdit) & Multithreading issues

Im currently trying to learn Networking with Python asyncore and pyqt4. I coded a small server, which basically listens on some port, and resends all messages it recieves to the sender. Since both qts QApplication.exec_() and asyncore.loop() are functions which never return i could not start them both in one thread, so i stared asyncor...

I'm in MVVM ViewModel hell

So far, I am really happy with the way things have gone in my app's transition from typical click event handlers everywhere, to complete GUI decoupling. Now I'm running into something I can't quite figure out, and it's related to a window that I want my GUI to pop up, and it needs to display information from the model. I guess the shor...

Intensive file I/O and data processing in C#

I'm writing an app which needs to process a large text file (comma-separated with several different types of records - I do not have the power or inclination to change the data storage format). It reads in records (often all the records in the file sequentially, but not always), then the data for each record is passed off for some proce...

What work-arounds can be applied to thread-unsafe autoload in ruby?

As mentioned in this question, autoloading within a thread can cause problems. What work-arounds can be applied? ...

Threading issues using Ping to map active IPs - C#

I am trying to create a simple Network Tool to ping all possible IPs on your local subnet and provide a list of such IPs in a DataGridView. I am new to having to consider threading which is a good thing to come across as a budding programmer. Sorry, but you are probably going to have to do some explaining to me, but in my mind this sho...

Speeding up a PHP App

I have a list of data that needs to be processed. The way it works right now is this: A user clicks a process button. The PHP code takes the first item that needs to be processed, takes 15-25 secs to process it, moves on to the next item, and so on. This takes way too long. What I'd like instead is that: The user clicks the proces...

What is a good tool for the investigation of Database Connection usage in Java?

What is a good tool for the investigation of Database Connection usage in Java? A developer is supporting a complex Java program which is ocassionally exhausting the number of Database connections available. Since the problem is sporadic it would be useful to know which thread has opened multiple connections to the database to focus the...

Parallel Computing In Java

How can I make use of parallel in Java? Or do I use normal threads? ...

How to run two functions simultaneously

Hello, I am running test but I want to run 2 functions at the same time. I have a camera and I am telling it to move via suds, I am then logging into the camera via SSH to check the speed the camera is set to. When I check the speed the camera has stopped so no speed is available. Is there a way I can get these functions to run at the s...

Java Thread - weird Thread.interrupted() and future.cancel(true) behaviour

Hi all, I want to manage a list of Futures objects returned by my TaskExecutor. I've something like this List<Future<String>> list void process(ProcessThis processThis) { for ( ...) { Future<String> future = taskExecutor.submit(processThis); list.add(future) } } void removeFutures() { for(Future fu...