multithreading

Comparing CPU speed likely improvements for business hardware upgrade justification

I have c# Console app, Monte Carlo simulation entirely CPU bound, execution time is inversely proportional to the number of dedicated threads/cores available (I keep a 1:1 ratio between cores/threads). It currently runs daily on: AMD Opteron 275 @ 2.21 GHz (4 core) The app is multithread using 3 threads, the 4th thread is for another...

Child process stops when Thread.sleep() is called (in Java under Windows)

I have a Java application that launches an external process (Internet Explorer) using ProcessBuilder. Strangely enough, this child process freezes when the parent Java thread calls Thread.sleep. It does not happen with all processes, for instance Firefox, but with IE it happens all the time. Any ideas ? P.S. I tried Robot.delay() with...

Multi-threaded WebRequest calls and contention

I'm running a C# Console Application that is multi-threaded. The core process retrieves some data to work on, splits it up into a configurable number of smaller datasets, and then spawns the same number of threads to process each subset of data. To process an individual record, a thread has to make a call to a web service using the WebR...

Twitter Threading Script

Is there a free open source Twitter Threading script/platform? ...

Processor Utilization by threads spawned by a program

I have a java program which spawns multiple threads say, 10-20 threads. This program is scheduled to be run on a machine that has 32 processors. I am keen to know if all the processors' power would be utilized by these threads. Solaris is the environment; does that make any difference? ...

Multi thread .NET application causes Application Error in KERNEL32.dll running on 64 bit quad core Windows Server.

I have a multi-threaded .NET application that occasionally terminates without any message. When I check the log there is an entry for an "Application Error in KERNEL32.dll". What could be causing this? Here is some basic code: foreach (int id in ids) { ThreadPool.QueueUserWorkItem(new WaitCallback(ProcessData), id); } The ProcessDa...

Porting from Ruby 1.8.5 to 1.8.6 | Thread problem

I'm trying to get a sample to work with Ruby 1.8.6. The problem is that the sample was written for Ruby 1.8.5. My assumption is that the problem lies in the way the Thread is called, or not called. This is the sample: class Timer def initialize(resolution) @resolution = resolution @queue = [] Thread.new do while tr...

LPTHREAD_START_ROUTINE / array of classes

I wrote some test code like this which compiled and worked fine... void threadtest() { HANDLE hThrd; DWORD threadId; int i; for (i = 0;i < 5;i++) { hThrd = CreateThread( NULL, 0, ThreadFunc, (LPVOID)i, 0, &threadId ); } // more stuff } DWORD WINAPI ThreadFunc(LPVOID n) { // stuff...

Connection to same URL in different threads using HttpClient

What is the correct method to get the content of an URL in multiple threads using HttpClient in java? For example loading a List with items, loading each item in a different thread at the same time and getting the information from the same URL with different parameters. In a application I am creating it gives me no element found except...

Python: time a method call and stop it if time is exceeded

I need to dynamically load code (comes as source), run it and get the results. The code that I load always includes a run method, which returns the needed results. Everything looks ridiculously easy, as usual in Python, since I can do exec(source) #source includes run() definition result = run(params) #do stuff with result The only pr...

Thread-safe checking variable for a midlet

Hi, I'm programming a game in j2me in the client side, that connects to a server written in java. This game is going to have a chat feature, but as a secondary feature. For every midlet that connects to the server, a server-game thread is spawned. These threads talk between them, so that they can synchronize and write in turns to a ser...

What's the life-time of a thread-local value in Python?

import threading mydata = threading.local() def run(): # When will the garbage collector be able to destroy the object created # here? After the thread exits from ``run()``? After ``join()`` is called? # Or will it survive the thread in which it was created, and live until # ``mydata`` is garbage-collected? mydata.f...

VB.Net Running Threading with Reflected Objects

Running into problems creating objects through reflection and then running them on multiple threads. I just cannot seem to figure out what I need to here: For Each WorkerNode As XmlNode In oRunSettings.GetWorkerValues Dim sWorkerName = WorkerNode.Attributes(SETTING_NAME_ID).Value Dim oWorkerT...

How to get information about what code is running in a thread?

I have a Window Forms application (using clickonce installation, running on a terminal server) that occasionaly ends up with a thread that appears to be running in a tight loop. The user doesn't know this happens as the app continues to run as expected. Also I have determined that I can kill the problem thread without any apparent affect...

What is the best way to manage connection pooling using threads?

I have done a fair amount of searches, but couldn't find any thing regarding this topic. We have a telnet server that does data processing. Logging in telnet has overhead (time), so what I want to do is have a service (WCF) that spawns n number connections and act as the broker between applications/requests and the server. All of th...

Setting thread priority in Linux with Boost

The Boost Libraries don't seem to have a device for setting a thread's priority. Would this be the best code to use on Linux or is there a better method? boost::thread myThread( MyFunction() ); struct sched_param param; param.sched_priority = 90; pthread_attr_setschedparam( myThread.native_handle(), SCHED_RR, &param); I don't have al...

Actionscript PNGEncoder performance and UI blocking.

I'm trying to use PNGEncoder to encode a bitmapData object into a png ByteArray so I can send the data to the server. Everything would be peachy except the bitmapData is 4000x4000px and when I run the PNGEncoder.encode function on it the whole app stops (UI is blocked) for 5-8 seconds while it runs. Does anybody have any suggestions on...

What modules should I look at for doing multithreading in Perl?

What modules should I look at for doing multithreading in Perl? I'm looking to do something fairly low performance; I want threads is to run multiple workers simultaneously, with each of them sleeping for varying amounts of time. ...

C#/.NET - How to trigger update of listview from another thread

It seems I'm forbidden to access (i.e. update) my list view control from another thread than the main thread. How can I perform some threaded task and then signal somehow to start the update of the listview? ...

How to start thread if button pressed and stop it if pressed again ?

Hi all I'm using the next code to do what I'm asking for : private delegate void CallerDelegate(object e); CallerDelegate caler = new CallerDelegate(MethodToCall); on button click event : if (currBusyThrd != null && currBusyThrd.IsAlive) { currBusyThrd.Abort(); } ThreadPool.SetMaxThreads(1, 1); //queue the work for thread p...