multithreading

Helgrind for Windows?

Helgrind is a Valgrind tool for detecting synchronisation errors in C, C++ and Fortran programs that use the POSIX pthreads threading primitives. Anyone knows an equivalent tool for windows? After googling a bit I haven't found anything... ...

Looking for a framework that handles cancellation of HTTP Callables

I will be making multiple HTTP calls concurrently and want to allow the user to selectively cancel certain tasks if they take too long. A typical scenario: 1 task pulls twitter feed and another pulls facebook wall posts. The number of tasks is obviously variable, so the idea of a queue comes naturally. I've looked at ExecutorCompletionSe...

ManualResetEvent vs. Thread.Sleep

I implemented the following background processing thread, where Jobs is a Queue<T>: static void WorkThread() { while (working) { var job; lock (Jobs) { if (Jobs.Count > 0) job = Jobs.Dequeue(); } if (job == null) { Thread.Sleep(1); ...

c# migrate a single threaded app to multi-threaded, parallel execution, monte carlo simulation

I've been tasked with taking an existing single threaded monte carlo simulation and optimising it. This is a c# console app, no db access it loads data once from a csv file and writes it out at the end, so it's pretty much just CPU bound, also only uses about 50mb of memory. I've run it through Jetbrains dotTrace profiler. Of total exec...

Thread aborting because of a function which closes the form.

hi, I am using the below function to close the existing form and open a new form. I have a function running as thread which shud run in background always. when i call the below function from my function in thread, the thread is not doing its work after that. May be the thread is aborting. How to resolve this. Thanks. static public void...

glibmm timeout signal

I'm working on a plugin for a smaller application using gtkmm. The plugin I'm working on checks certain conditions (the date had changed and a new day started) after every minute and starts some actions if the conditions are true. In the initialization part of the plugin I have the following piece of code that uses Glib::SignalTimeout an...

Native threads using Java VM in Eclipse

Hi, I would like to run a Java program that uses the Thread class such that each Thread.run() results in running a proper kernel thread. Is there a way to achieve this by passing some command line parameter to the Java VM ? I am running Eclipse using Java 1.5 SDK (and jre1.5.0_18) on a Windows machine. I tried using -XX:+UseBoundThreads...

Portable periodic timer for period around 100ms

Hej! I am looking for a portable way of periodically dispatching a task in a C++ project. The use of libraries such as boost should be avoided in this particular project. The resolution requirement is not too serious: between 5Hz to 20Hz on an average Netbook. The project uses OpenGL to render the HMI but since I am working on the bac...

NSThread exit when app terminate

I have an iphone app, it run some thread to compute search. The search is made calling a time consuming function from a library. I need to exit from the thread when the app is terminating, otherwise the thread continue to run and the search create problem when i reopen the app. I tried to subscribe in the thread [[NSNotificationCen...

SyncLock on SyncRoot

I have created a synchronized queue and am using SyncLock on the SyncRoot property of that queue when I invoke the Enqueue/Dequeue methods. The methods are invoked from instances of standard producer/consumer classes. Is that a proper use of the SyncRoot property? Would it be better practice to create a private shared object in each c...

Sharepoint, IIS, .net, and multithreading

I am aware that IIS is configure for multithreading as standard. I am having performance issues with my web servers hosting Sharepoint 2007. So my question is; Does Sharepoint 2007 use multithreading as standard out of the box solution, or is it only customisations using .net? And does anyone know how I could limit users creating mu...

Does Jython have the GIL?

I was sure that it hasn't, but looking for a definite answer on the Interwebs left me in doubt. For example, I got a 2008 post which sort of looked like a joke at first glance but seemed to be serious at looking closer. Edit: ... and turned out to be a joke after looking even closer. Sorry for the confusion. Actually the comments on tha...

How to get a silverlight dependency property when not on the UI thread?

I have essentially the same problem discussed here: http://khason.net/blog/dependency-property-getters-and-setters-in-multithreaded-environment/ public static readonly DependencyProperty MyPropertyProperty = DependencyProperty.RegisterAttached("MyProperty", typeof(bool), typeof(MyObject), new PropertyMetadata(new Propert...

Performances issues when launching an application on a parallel machine

Hi, I've a really strange problem: I've an application that launches some workers on parallel: for (it = jobList.begin(); it != jobList.end(); it++) { DWORD threadId; Job job = *it; Worker *worker = new Worker(job); workers[i] = worker; threads[i++] = CreateThread((LPSECURITY_ATTRIBUTES)NULL, (DWORD)0, &launchThread...

Lucene.Net and I/O Threading issue

Hello all, I have an indexing function named "Execute()" using IndexWriter to index my site's content. It works great if I simply called it from a web page, but failed when I have it as a delegate parameter into System.Threading.Thread. Strangely though, it always work on my local dev machine, it only fails when I uploads to a shared ho...

java & threads: interrupted exceptions & how to properly use BlockingQueue's take() method

Hi all, My first question is what exactly happens when there is nothing on the queue and a take() is called. The API says the method will wait but does that mean the CPU spins checking for empty/not empty until an item is on the queue or does it mean that the thread yields and will be awoken by an interrupt? If it is the case of the f...

What is the basic difference between NSTimer, NSTask, NSThread and NSRunloop ?

What is the difference between NSTimer, NSTask, NSThread and NSRunloop and is there a guideline on when to use each of them? ...

How to update Gtk::TreeModel::Row from external function

Currently I'm developing a multi-thread application. I use a TreeView to display the states of each thread, one row per thread. There are mainly two classes: Main GUI class containing TreeView class for thread handling Passing Gtk::TreeModel::iterator as an argument to the second class is not viable since we cannot access the element...

Is firing off a Thread a valid answer to simplifying code?

As multi-processor and multi-core computers become more and more ubiquitous, is simply firing off a new thread a (relatively) simple and painless way of simplifying code? For instance, in a current personal project, I have a network server listening on a port. Since this is just a personal project, it's just a desktop app, with a GUI int...

What is the system effect of starting large quantities of timers in Java?

Hello, recently I have had to program some applications that require large amounts of timed tasks to occur. However, I'm afraid to create so many timers because I haven't been able to figure out how they are handled by Java. Is there a problem with starting large quantities of scheduled tasks? If so, what is the better alternative? ...