multithreading

WebClient error when using a thread in .NET

I'm having a very weird error using the WebClient class in .NET 4. The app simply downloads some files off the internet and provides output on a textbox (the GUI is WPF). The method that does this is the following: void DownloadFiles(object files) { fileL = (List<string>) files; foreach (string url in fileL) { byte[...

Java Multithreading Challenge

Can someone please explain or give an example on how to create multiple threads with different functionalities in Java? This is the code... I am trying to create a thread that does what public void rnd_list() is supposed to do ( a list of 30 random numbers) which is a different task than the one define in public void run() which is the...

COM Events, Threading and silverlight!

Hi all, I'm working on a concept that will allow Silverlight to communicate with POS peripherals by using the POS for .Net library. I need to be able to able to call into the library to catch bar-code scans and print receipts etc. This all works fine if the application is a winforms app but in my proof of concept console app it the event...

look for C# multithread application with plugin architecture

I'm looking for an example of multithread C# application who use plug'in architecture, can any one help me please ? many thanks ...

How do I know if a boost thread is done ?

I am using boost::thread to process messages in a queue. When a first message comes I start a message processing thread. When a second message comes I check if the message processing thread is done. if it is done I start a new one if it is not done I don nothing. How do I know if the thread is done ? I tried with joinable() but it is ...

Null object that is not null

Hello, I use 2 threads to act like a produce/consumer using double queue (http://www.codeproject.com/KB/threads/DoubleQueue.aspx). Sometimes in my 2nd thread, I get an object that is NULL but it should not be as I filled it in the first thread. I tried this: if(myObject.Data == null) { Console.WriteLine("Null Object") // <-- Breakpo...

how to use Thread in java ?

Hi all i have code use googleseach API I want to use Thread to improve speed of my program. But i have a problem here is code import java.io.BufferedReader; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.net.URLEnco...

C#: Populating a UI using separate threads.

I'm trying to make some sense out of an application Ive been handed in order to track down the source of an error. Theres a bit of code (simplified here) which creates four threads which in turn populate list views on the main form. Each method gets data from the database and retrieves graphics from a resource dll in order to directly po...

Google Javascript v8 - multithreading

Hi guys Suppose I have the following piece of code bool run (void) { HandleScope hande_scope; Handle<String> source; Local<Script> script; Persistent<Context> context; context = Context::New(); Context::Scope context_scope(context); script = Script::Compile("var a = 1; var b = 2;"); Local<Value> result...

Castle ActiveRecord: session error search and access to lazy loading property in different threads

Hi *, I've got a problem with an multi-threaded desktop application using Castle ActiveRecord in C#: To keep the GUI alive while searching for the objects based on userinput I'm using the BackgroundWorker for the search-function. Some of the properties of the objects, especially some HasMany-Relations, are marked as Lazy. Now, when th...

java background task

I was wondering which would be the most efficient approach to implement some kind of background task in java (I guess that would be some kind of nonblocking Threads). To be more precise - I have some java code and then at some point I need to execute a long running operation. What I would like to do is to execute that operation in the ba...

Maximum Amount of Time A Thread Can Run?

I have a web service that creates a thread to process some data in the background. I've seen a "System.Threading.ThreadAbortException: Thread was being aborted" message in one of my logs where the thread was killed. I am currently under the assumption that the thread will run as long as it takes to execute the tasks that it's working o...

Async stream writing in a thread

I have a thread in which I write to 2 streams. The problem is that the thread is blocked until the first one finishes writing (until all data is transferred on the other side of the pipe), and I don't want that. Is there a way to make it asynchronous? chunkOutput is a Dictionary filled with data from multiple threads, so the faster check...

C++ Win/Linux thread syncronization Event

Hello I have some code that is cross-platform by unsing #ifdef OS, I have a Queue protected by a CriticalSection on Windows, and by a pthread_mutex_t on Linux. I would like to implement a Wait(timeout) call that would block a thread until something has been enqueued. I though about using WaitForSingleObject on windows but it don't seem...

Java Stop Server Thread

the following code is server code in my app: private int serverPort; private Thread serverThread = null; public void networkListen(int port){ serverPort = port; if (serverThread == null){ Runnable serverRunnable = new ServerRunnable(); serverThread = new Thread(serverRunnable); serverThread.start(); ...

How can I locate an open web services call in .NET/WCF?

I'm working on a project where a large number of clients will be connecting to a WCF web service. When they connect, the web service will sleep until an event occurs on another WCF service running on a different server. I want the other service to "wake up" the client service when the event occurs using another WCF service call on the ba...

make a thread which recieves values from other threads

This program in Java creates a list of 15 numbers and creates 3 threads to search for the maximum in a given interval. I want to create another thread that takes those 3 numbers and get the maximum. but i don't know how to get those values in the other thread. public class apple implements Runnable{ String name; int time, number, first...

How do i make a multi-threaded server in perl?

I have looked online at making a multi-threaded server in perl, but i cannot find any good ones that clearly explain how to create one. I have created a server and client in perl but i do not seem to be able to make it multi-threaded. Can someone help me? ...

boost.threads Singleton initialization

hello. Is there preferred way to initialize (lazily) singleton data when using multiple threads from boost.threads? Thanks. ...

WPF - Pausing the UI Thread?

I have a tab control with draggable tabs. When the mouse is released it removes the selected tab from the tabControl and adds it to its new location. My problem is that the TabControl draws itself after removing the tab, and then again when adding the tab so there is a very noticeable flicker that shows the tab behind the tab being moved...