multithreading

In .NET when Aborting Thread, can this piece of code get corrupted?

Little intro: In complex multithreaded aplication (enterprise service bus ESB), I need to use Thread.Abort, because this ESB accepts user written modules which communicates with hardware security modules. So if this module gets deadlocked or hardware stops responding - i need to just unload this module and rest of this server aplicatio...

C# Book on Windows Services and Multi-threading

Can you recommend a good book -- or other learning resource -- for using C# to build Windows Services that are multi-threaded? Specifically, I am using Visual Studio 2008 with .Net Framework 3.5. The books that I am finding deal with web services. Further, I am finding next to nothing on multi-threading. Thanks in advance, Wolfgang ...

while(1) block my recv thread

Hello. I have a problem with this code. As you can see a launch with an internal thread recv so that the program is blocked pending a given but will continue its execution, leaving the task to lock the thread. My program would continue to receive the recv data socket new_sd and so I entered an infinite loop (the commented code). The prob...

Threads or background processes in Google App Engine (GAE)

Hey, I'm running a post, and need the request to be replied fast. So I wanted to put a worker running some operations in background and reply the request imidiatly. The worker is always finite in operations and executes in [0;1] second How can I do this? Is there any module that suports this in the google app engine api? Edit: In py...

Getting progress reports from a layered worker class?

I have a layered worker class that I'm trying to get progress reports from. What I have looks something like this: public class Form1 { private void Start_Click() { Controller controller = new Controller(); controller.RunProcess(); } } public class Controller { public void RunProcess() { Th...

Multi-Thread Programming

Is there a function call that can associate with a specific thread to make the thread run or wait? I have 4 threads in my program and I am trying to figure out a way to tell any one of the threads to wait or run when I want them to. ...

C# 4.0 how to pass variables to threads?

How would i pass some parameters to a new thread that runs a function from another class ? What i'm trying to do is to pass an array or multiple variables to a function that sits in another class and its called by a new thread. i have tried to do it like this > Functions functions = new Functions(); string[] data; Thread...

Using the Queue class in Python 2.6

Let's assume I'm stuck using Python 2.6, and can't upgrade (even if that would help). I've written a program that uses the Queue class. My producer is a simple directory listing. My consumer threads pull a file from the queue, and do stuff with it. If the file has already been processed, I skip it. The processed list is generated bef...

Capture RTSP stream to fixed sized files

Hi, I want to capture a RTSP stream from a camera into a series of fixed sized file 1MB each. and then send it to a storage server via Http POST. How do i do this. Target languages - any, prefer: JAVA. ...

XNA Xbox 360 Content Manager Thread freezing Draw Thread

I currently have a game that takes in large images, easily bigger than 1MB, to serve as backgrounds. I know exactly when this transition is supposed to take place, so I made a loader class to handle loading these large images in the background, but when I load the images it still freezes the main thread where the drawing takes place. Sin...

ldd output showing shared object file whose function is not called

I ran ldd command on an executable created by Open MPI. It shows a reference to libpthread.so Using LD_PRELOAD variable I created my own implementation of pthread_create, but from the it output it seems that MPI implementation is not calling pthread_create as I had expected. Why does ldd show pthread so file in output if it is not being ...

Nested multithread operations tracing

I've a code alike void ExecuteTraced(Action a, string message) { TraceOpStart(message); a(); TraceOpEnd(message); } The callback (a) could call ExecuteTraced again, and, in some cases, asynchronously (via ThreadPool, BeginInvoke, PLINQ etc, so I've no ability to explicitly mark operation scope). I want to trace all operati...

Thread Management Object

I feel rather foolish as this is just a short question. I was reading about a bunch of thread management helper classes in .net, specifically one that aids the storage of threads to help a service manager object automatically invoke delegates onto the subscribing thread. I'm pretty sure it had something to do with creating dispatchers. ...

Java - How to detect that the internet connection has got disconnected through a java desktop application?

I am developing a Java Desktop Application that access internet. It is a multi-threaded application, each thread do the same work (means each thread is an instance of same Thread class). Now, as all the threads need internet connection to be active, there should be some mechanism that detects whether an internet connection is active or ...

Starting one BlackBerry screen from another.

I've recently run into a snag while putting on the finishing touches for my BlackBerry app. I'm building a login screen which, if the user is successful in logging in, goes to a data loading screen, and then to a home screen. From the home screen, you can use the app. Everything works great but one thing, I can't seamlessly move from ...

Core Data Errors vs Exceptions Part 3

My question is similar to this one. Background I'm creating a large number of objects in a core data store using NSOperations to speed things up. I've followed all the Core Data multithreading rules - I've got a single persistent store coordinator and a managed object context per thread that on save is merging back to the main managed...

is this class thread safe?

consider this class,with no instance variables and only methods which are non-synchronous can we infer from this info that this class in Thread-safe? public class test{ public void test1{ // do something } public void test2{ // do something } public void test3{ // do something } } ...

Understanding java's native threads and the jvm

I understand that the jvm is itself an application that turns the bytecode of the java executable into native machine code, but when using native threads I have some questions that I just cannot seem to answer. Does every thread create their own instance of the jvm to handle their particular execution? If not then does the jvm have to ...

Need help with Java Producer Consumer Problem, NullPointerException

This is my code: package test; import java.util.logging.Level; import java.util.logging.Logger; class Data{ int ar[]=new int[50]; int ptr; Data() { for(int i=0;i<50;i++) ar[i]=0; ptr=0; } public int produce() { if(this.ptr<50) { this.ar[this.ptr]=1; ...

asp.net Background Threads Exception Handling

In my 3.5 .net web application I have a background thread that does a lot of work (the application is similar to mint.com in that it does a lot of account aggregation on background threads). I do extensive exception handling within the thread performing the aggregation but there's always the chance an unhandled exception will be thrown a...