multithreading

Bigger threadpool or additional ExecutorService when new kind of thread will run?

Hi, I have a question that is related to possible overhead of ExecutorServices in Java. The present implementation has ExecutorService A with a capacity of 5 threads. It runs threads of type A. type A threads do some database reading and writing. Now, a thread of type B will run after some threads of type A has finished. The num...

make thread with method take sql connection

how to use ParameterizedThreadStart in c# I want to make threads take void method and this method take sqlconnection ? ...

JVM - Heap and Stack

Hello All... Whenever a class is loaded, what are stored in the heap and what are stored in the stack ? Also where does the threads reside ? Thanks in advance... ...

VC++ / C++ High performance Multithreaded GUI considerations for trading

I'm interested in seeing what considerations experienced developers make when developing high performance multithreaded GUI's for a windows platform. I ask this question in the context of developing trading applications where GUI's are very dynamic and application latency is an issue. What architectures have you seen or would you recom...

Can two threads of the same process produce the same GUID?

Dear ladies and sirs. If two threads in a process generate a new GUID concurrently using .NET API (Guid.NewGuid()) is it possible that the two GUIDs will be identical? Thanks. UPDATE I want to get practical. I know that it is widely assumed that GUIDs are unique for all practical purposes. I am wondering if I can treat GUIDS produced ...

Fastest HTML Downloader

I want the fastest method to download the source of HTML with given URL address Is there any solution beyond normal C# solutions like (WebClient Download or HttpWebRequest, HttpWebResponse) that speed up fetching HTML source code ?? ...

Using Threads to Handle Sockets

I am working on a java program that is essentially a chat room. This is an assignment for class so no code please, I am just having some issues determining the most feasible way to handle what I need to do. I have a server program already setup for a single client using threads to get the data input stream and a thread to handle sending ...

Linux 2.6.31 Scheduler and Multithreaded Jobs

I run massively parallel scientific computing jobs on a shared Linux computer with 24 cores. Most of the time my jobs are capable of scaling to 24 cores when nothing else is running on this computer. However, it seems like when even one single-threaded job that isn't mine is running, my 24-thread jobs (which I set for high nice values)...

C# Thread Spawn Parameter Passing

Scenario I have a line of code whereby I pass a good number of parameters into a method. CODE as described above foreach(Asset asset in assetList) { asset.ContributePrice(m_frontMonthPrice, m_Vol, m_divisor, m_refPrice, m_type, m_overrideVol, i, m_decimalPlaces, metalUSDFID, metalEURFID); } What I really want to do... What I real...

JAVA - Cancel the ThreadPoolExecutor running tasks

What I need is a method similar to shutdownNow, but, be able to submit new tasks after that. My ThreadPoolExecutor will be accepting a random number of tasks during my program execution. ...

Boost Multithreading

Can anyone tell what's going on here? When I try debug the code and when the control is in thread() function at Line 15, it skips over the Line 16 move to Line 17 and goes back Line 16. Why wouldn't it move Line by Line? 1. #include <boost/thread.hpp> 2. #include <iostream> 3. 4. void wait(int seconds) 5. { 6. boost::this_thread::...

Catch a thread's exception in the caller thread in Python

Hi Everyone, I'm very new to Python and multithreaded programming in general. Basically, I have a script that will copy files to another location. I would like this to be placed in another thread so I can output .... to indicate that the script is still running. The problem that I am having is that if the files cannot be copied it wi...

Android 2.1: Muliple Handlers in a Single Activity

Hi, I've more than one Handlers in an Activity. I create all the handlers in the onCreate() of the main activity. My understanding is the handleMessage() method of each handler will never be called at the same time because all messages are put in the same queue (the Activity thread MessageQueue). Therefore, they will be executed in the...

Silverlight 4 Multithread

I'm trying to update my Silverlight 4 UI approx every 1/2 second with new data. I've hooked into a WCF service using net.tcp binding and issuing callbacks from the server. To make sure I get the data from the service as quickly as possible I've started up my proxy on a backround worker inside of my Silverlight App. My question is, how...

What's the deal with the hidden Throw when catching a ThreadAbortException?

I'm going through a book of general c# development, and I've come to the thread abort section. The book says something along the lines that when you call Thread.Abort() on another thread, that thread will throw a ThreadAbortException, and even if you tried to supress it it would automatically rethrow it, unless you did some bs that's ge...

Simple Android Binary Text Clock

Hello, I want to create a simple android binary clock but my application crashes. I use 6 textview fields: 3 for the decimal and 3 for the binary representation of the current time (HH:mm:ss). Here's the code: import java.text.SimpleDateFormat; import java.util.Calendar; import android.app.Activity; import android.os.Bundle; import an...

Does a multithreaded crawler in Python really speed things up?

Was looking to write a little web crawler in python. I was starting to investigate writing it as a multithreaded script, one pool of threads downloading and one pool processing results. Due to the GIL would it actually do simultaneous downloading? How does the GIL affect a web crawler? Would each thread pick some data off the socket, the...

C functions invoked as threads - Linux userland program

I'm writing a linux daemon in C which gets values from an ADC by SPI interface (ioctl). The SPI (spidev - userland) seems to be a bit unstable and freezes the daemon at random times. I need to have some better control of the calls to the functions getting the values, and I was thinking of making it as a thread which I could wait for to ...

Boost thread synchronization in release build

Hi, when I try to run the following code in debug and release mode in VS2005. Each time I see different output in console and It doesn't seem like the multithreading is achieved in release mode. 1. #include <boost/thread.hpp> 2. #include <iostream> 3. 4. void wait(int seconds) 5. { 6. boost::this_thread::sleep(boost::posix_time::s...

Implementing java FixedTreadPool status listener

It's about an application which is supposed to process (VAD, Loudness, Clipping) a lot of soundfiles (e.g. 100k). At this time, I create as many worker threads (callables) as I can put into memory, and then run all with a threadPool.invokeAll(), write results to file system, unload processed files and continue at step 1. Due to the fact ...