multithreading

MIDP application, blocked by Connector.Open(..)

Hi all i've been having the worst time of my life trying to understand why this is happening, any input would be greatly appriciated. The code in question runs in a diffrent thread then the midlet, although the thread starts after the connection is made, I've tried the other way around and i end up at the same spot.. when executing thi...

iPhone/Cocoa Touch - problem with multithreading (Stanford Presence 3 project)

I have been solving the Stanford free iPhone course project called Presence 3 (found on the stanford site: www.stanford.edu/class/cs193p/cgi-bin/downloads.php, which pulls data from twitter for users, which are stored in a plist. A UIActivityIndicator (spinner) is visible while the data is loading. Once the data has been loaded, a TableV...

How do you implement Software Transactional Memory?

In terms of actual low level atomic instructions and memory fences (I assume they're used), how do you implement STM? The part that's mysterious to me is that given some arbitrary chunk of code, you need a way to go back afterward and determine if the values used in each step were valid. How do you do that, and how do you do it efficient...

Python Package For Multi-Threaded Spider w/ Proxy Support?

Instead of just using urllib does anyone know of the most efficient package for fast, multithreaded downloading of URLs that can operate through http proxies? I know of a few such as Twisted, Scrapy, libcurl etc. but I don't know enough about them to make a decision or even if they can use proxies.. Anyone know of the best one for my pur...

WCF and a longer operation after executing a service

I have a WCF service with many methods. I would like that after executing one of the methods emails will be send to some users. Sending emails may be a long running operation and I don't want a caller of the method to await this time. The caller should receive a response as soon as it is computed and the emails should be send afterwards....

How to make Sleep on background thread work with Invoke

I have a PictureBox control on a Form that is supposed to draw something every 100ms. The background thread performs some calculation in a loop and after every iteration, it fires an event. Edited (as a reply to a comment): World world = new World(); void CreateBackgroundThread() { Thread backgroundThread = new Thread(world.Backg...

Are there any known issues with django and multithreading?

I need to develop an app that runs side by side with a django-app. This will be the first time i develop a multithreaded app that runs next to a django-app so are there any 'gotchas' and 'traps' i should be aware of? ...

Thread pools in CocoaTouch?

I have a set of tasks that are done repeatedly and instead of creating a new thread each time this user-invoked task needs to be performed, I'd like to use a thread-pool. In the typical flow to create a new thread, you have to setup an auto-release pool each time the thread entry point is invoked. It seems that the performance for this...

How does Tomcat sandbox web apps?

I have a web app that is being served through Tomcat. My app lets users submit their own workflow which will then be executed on the server. My problem is how to control how much memory each user is taking up on the server. I think Tomcat itself runs apps in a sandbox of its own. I say this because when my app runs out of memory and cras...

Accessing a single file with multiple threads

I need to access a file concurrently with multiple threads. This needs to be done concurrently, without thread serialisation for performance reasons. The file in particular has been created with the 'temporary' file attribute that encourages windows to keep the file in the system cache. This means most of the time the file read wont go ...

Static Semaphore passed as member to Thread class instance = bug?

There are a few windows service projects in our codebase that follow this model, and I just want to make sure it's not a bug. In this model, there is at least one static "timer" class, managed by a System.Timers.Timer, that retrieves batches of data to process from the database. A Semaphore is initialized as a static member. After re...

Multi-Threading question in Objective-C 2.0

Hi there, I have my main application delegate which contains a method that returns an object. This application delegate runs on the main thread. I also have a NSOperation that gets run on a different thread. As well as wanting to be able to call my app delegate method on my main thread sometimes, I also need to call it from my NSOperat...

What is a good multithreading book for Delphi?

Where can I get a good book on Delphi threading. Something that will suit a total newcomer to the subject. ...

Is there a way to find a control's owner thread?

Hello, I am having some threading issues with a large app I am working on (getting cross-thread exceptions). Is there a way to find the thread name/id that a particular control was created on? The error occurs when I try to add a new control to my control's control collection. I can't really create a small, reproducible sample so I wi...

Is this (Lock-Free) Queue Implementation Thread-Safe?

I am trying to create a lock-free queue implementation in Java, mainly for personal learning. The queue should be a general one, allowing any number of readers and/or writers concurrently. Would you please review it, and suggest any improvements/issues you find? Thank you. import java.util.concurrent.atomic.AtomicReference; public cl...

Terminate a multi-thread python program

How to make a multi-thread python program response to Ctrl+C key event? Edit: The code is like this: import threading current = 0 class MyThread(threading.Thread): def __init__(self, total): threading.Thread.__init__(self) self.total = total def stop(self): self._Thread__stop() def run(self): ...

Are "benaphores" worth implementing on modern OS's?

Hi all, Back in my days as a BeOS programmer, I read this article by Benoit Schillings, describing how to create a "benaphore": a method of using atomic variable to enforce a critical section that avoids the need acquire/release a mutex in the common (no-contention) case. I thought that was rather clever, and it seems like you could ...

Flexible CountDownLatch?

I have encountered a problem twice now whereby a producer thread produces N work items, submits them to an ExecutorService and then needs to wait until all N items have been processed. Caveats N is not known in advance. If it were I would simply create a CountDownLatch and then have producer thread await() until all work was complete...

Killing non-waiting thread

Hi, I need to kill specific worker thread in my application. I don't have any control over its execution, which means I cannot employ classic signal boolean variable approach. This thread is non-waiting. It doesn't sleep or wait on some monitor to be signalled - I can't interrupt it via Thread.interrupt, this throws IllegalThreadState ex...

ThreadPools for speeding up a site

I've tried to figure out whether using ThreadPools in an ASP.NET site is good or not. There's a lot of discussion about this but difficult to find an authorative source. I'm building a site where the user fills out a form and presses the send button, this triggers a mail to be sent. My problem is that my mail vendor's API is quite slow ...