multithreading

Aborting a thread in ASP.NET

protected System.Threading.Thread m_searchthread = null; Question: I've implemented a search algorithm, which a user can start from an ASP.NET website. When the user clicks on Button "Start", this code is executed: m_searchthread = new System.Threading.Thread(new System.Threading.ThreadStart(Search)); m_searchthread.IsBackground = tr...

Controlling the java scheduling algorithm

Hi, I was talking to an interesting interviewee today, who insisted that the best way to improve the performance of our Java application was to rewrite the thread scheduling algorithm. Given that we rely on the JVM thread scheduling algorithm I'm reasonably sure this isn't possible, but I was wondering if there's any techniques you can ...

java multithreaded ajax update

I have jsp, which does ajax requests to a controller and passes IP's and shell commands that server will do. For example, ajax request has params "127.0.0.1", "ls -la, ls". (commands - is a list) Server executes these commands in separate threads(one thread per IP, or other) and updates table on jsp which contains output data of these co...

Java GUI and threads

I have a GUI which has textarea and buttons and etc......... I have a different class which is a thread that is running constantly. I want to append text to the textarea when certain conditions are met in the thread class. In the class containing the textarea i have getter methods for the textarea. I have also declared that class(conta...

How to make boost::thread_group execute a fixed number of parallel threads

This is the code to create a thread_group and execute all threads in parallel: boost::thread_group group; for (int i = 0; i < 15; ++i) group.create_thread(aFunctionToExecute); group.join_all(); This code will execute all threads at once. What I want to do is to execute them all but 4 maximum in parallel. When on is terminated, ano...

Interacting with two UI threads using different windows

My application is using an image processing library to handle a long running task. The main UI with settings and controls is implemented in WPF. The image processing needs to be displayed and the main UI needs to remain responsive. Upon clicking the 'process' button in the main UI a new thread is spawned which creates a new WinForm windo...

How to make a Win Service run Long Term with Threading.

I have a win service hosting a few workflows (a WorkflowApplication and a WorkflowServiceHost) that I need to keep long running. Because OnStart() requires that it completes and returns to the OS, I have a main method that fires on another thread in a threadpool. My Onstart() mainly looks like this protected override void OnStart(string...

How to implement this Queue in a Jboss cluster?

Hello everybody, my application works as a middle ware, receiving requests from clients, then transforming it in certain logic and sending the transformed requests to another service provider as normal HTTP requests or Webservice soap requests. The application was deployed on two jboss servers (in cluster) behind a load balancer. let's...

ASP C# update content

Hi all, I assume this is a simple question for you. Here we go: On my .aspx page, I have a label Label1 and a button Button1 surrounded by an Update Panel. A click on the Button invokes the code-behind method that looks as follows: protected void Click(object sender, EventArgs e) { ThreadProc("Hello"); Thread.Sleep(2000); ...

iphone - performSelectorOnMainThread with return value

I have the following method: - (NSMutableArray *)getElements:(NSString *)theURL; And I wanted to know if there is a way to call that method using performSelectorOnMainThread so that I can get the return value. So far, I've tried with: myArray = [object performSelectorOnMainThread:@selector(getElements:) ...

use an Android GestureOverlayView seperate from the game thread execution?

Hi I have a gesture activity class that listens out for when a gesture is performed on screen, which is connected to a GestureOverlayView which covers the entire screen. I have a main game thread DistractionsThread that is launched from the Distractions menu file. The thread deals with the physics and do draw methods that play the game ...

C/C++: duplicate main() loop in many threads

I have this "interesting" problem. I have this legacy code that looks like int main() { while(true) { doSomething(); } } I would like to duplicate that doSomething() in many threads, so that now main() would look like int main() { runManyThreads(threadEntry) } void threadEntry() { while(true) { doSomething(); } } ...

How System.Windows.Threading.Dispatcher in the main UI thread is accessible from other threads ?

I have read that we can not access anything in the main UI thread in Silverlight application from other worker threads. So why it is possible to access an object of class System.Windows.Threading.Dispatcher which is associated with the main UI thread from other worker threads when we want to delegate some work to be done on the User Int...

What mechanism do PIPES use to "wake up" the recipient?

I have two questions is one here. On Windows, I am familiar with pipes and how they work. However, I am curious as to what mechanism the OS uses to notify the recipient thread of a message arrival. Does the thread "poll & sleep" continuously for data? Does the OS check to see if the thread is sleeping and wake it up? Or is there some o...

Looking for an optimum multithread message queue

I want to run several threads inside a process. I'm looking for the most efficient way of being able to pass messages between the threads. Each thread would have a shared memory input message buffer. Other threads would write the appropriate buffer. Messages would have priority. I want to manage this process myself. Without getting in...

Get .NET thread type?

From my current process in .NET I can get a list of all its threads. Is it possible to find out what kind of thread it is? To get details if it's for example a worker, IO, CLR, backgroud or main thread? ...

basic python server using spawn/threads....

Hi. Got a problem that I'm facing. and it should be pretty simple. I have an app that places data into a dir "A". The data will be a series of files. I want to have a continually running server, that does a continual look at the dir, and on seeing a completed file in the dir, the server spawns/forks/creates a thread (not sure of the e...

Using the C# Volatile keyword in Threaded Application

I have a class that has a few arraylists in it. My main class creates a new instance of this class. My main class has at least 2 threads adding and removing from my class with the arraylists in it. At the moment everything is running fine but I was just wondering if it would be safer to declare my class with the arraylists in it as vol...

Is .NET Socket Send()/Receive() thread-safe?

Since a socket is full duplexed, meaning you can send and recieve simultaneously. So, is the .NET Socket Send()/Receive() thread-safe? I need to Send() and Receive() in 2 threads. ...

using static methods or instantiate the class?

Hi, recently i've got a dispute about using static methods in a class that is used by hundreds threads. In my opinion the "first" solution has no special benefits except it is easier to use for the client of class but i have been told that it is extremely bad idea and I have to use the "second" solution. Can anyone give me clear explan...