multithreading

Why is (javax.servlet.)SingleThreadModel deprecated?

Why is javax.servlet.SingleThreadModel deprecated? ...

How to implement progressbar(to show progress) using threading concept in win 32?

I am trying to show a progress bar while my process is going on...in my application there will be a situation where I gotta read files and manipulate them(it will take some time to complete)..want to display a progress bar during this operation..the particular function I am calling is an win 32 ...so if you check my code below i am upto ...

Thread Synchronisation 101

Previously I've written some very simple multithreaded code, and I've always been aware that at any time there could be a context switch right in the middle of what I'm doing, so I've always guarded access the shared variables through a CCriticalSection class that enters the critical section on construction and leaves it on destruction. ...

Limiting the number of threads executing a method at a single time.

We have a situation where we want to limit the number of paralell requests our application can make to its application server. We have potentially 100+ background threads running that will want to at some point make a call to the application server but only want 5 threads to be able to call SendMessage() (or whatever the method will be)...

processes vs threads (user vs kernel)

i understand the difference between a process and a thread. and i know the difference between a user thread and a kernel thread. my question is , how do you code any of them in c? all i know in c is how to create POSIX threads (but is this user threads or kernel threads)? can anyone put some c code samples for a process,user thread and a...

How to handle feedback from background threads if the user uses the back button?

I have the following problem: I have an Activity where a user can start a web search showing a new activity to show a progress bar until the results are shown. Now the user can either wait for the results or maybe think about the search parameters, hit the back button and triggering a new search. The search is running in an Async Task ...

UDP receiver with background threads

Hi, I am writing a UDP receiver using UdpClient class. IPEndPoint broadcastAddress = new IPEndPoint(IPAddress.Any, Settings.Default.SenderPort); UdpClient udpClient = new UdpClient(); udpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, 102400); udpClient.Client.SetSocketOption(SocketOptionLevel.So...

Select calls seems to not time out.

HI Folks, I have a threaded C++ program where up to three threads are calling select on a three separate socket descriptors waiting for data to become available. Each thread handles one socket and adds it to the readfds with a timeout of 300 seconds. After select returns if there is data available I'm calling recv to read it. Is ther...

How to give highest priority to events generated from main thread than those generated from secondary thread in wxWidgets

I have a c++ application written in wxWidgets, which has a main thread (GUI) and a working thread (calculations). The working thread executes commands requested by the main thread and communicates the result to the main thread posting an event after every step of the processing. The problem is that when the working thread is sending ma...

WPF Databinding thread safety?

Well lets say i have an object that i databind to, it implements INotifyPropertyChanged to tell the GUI when a value has changed... if i trigger this from a different thread than the GUI thread how would wpf behave? and will it make sure that it gets the value of the property from memory and not the cpu cache? more or less im asking i...

Is the FPU control word setting per-thread or per-process?

I need to change the FPU control word from its default setting in a multithreaded application. Is this setting per-thread or per-process? Does it have different scopes under Mac OS X and Windows? ...

Guaranteed semaphore order?

The documentation for the .NET Semaphore class states that: There is no guaranteed order, such as FIFO or LIFO, in which blocked threads enter the semaphore. In this case, if I want a guaranteed order (either FIFO or LIFO), what are my options? Is this something that just isn't easily possible? Would I have to write my own Semaph...

PyGTK, Glade, Changing the window view and threads

Heya Everyone, Forgive me if this seems like a stupid question, just so far no where on the internet can I find someone offering a solution to this and I just wanted to get some feedback from someone with more experience than myself (I've only been using python, pyGTK and Glade for 2 days now). I have a UI window displaying and it upda...

EXC_BAD_ACCESS with NSAutoReleasePool

I am detaching a new thread [NSThread detachNewThreadSelector:@selector(loadAvatar) toTarget:self withObject:nil]; I am getting an EXC_BAD_ACCESS on STObject* st = [cellitem get:@"stobject"]; In my following method -(void)loadAvatar { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; STObject* st = [cellite...

Illegal cross thread operation exception, unable to handle it

Hello, i am using visual C# express 2008. I SOMETIMES get the illegal cross thread operation in my invoke method when i try to run my project. It use the same invoke method in many places but its only at the beginning of another thread that i get the error. I check the InvokeRequired property, invoke the same method and in the 'else' co...

Total Order between !different! volatile variables?

Hi all, Consider the following Java code: volatile boolean v1 = false; volatile boolean v2 = false; //Thread A v1 = true; if (v2) System.out.println("v2 was true"); //Thread B v2 = true; if (v1) System.out.println("v1 was true"); If there was a globally visible total order for volatile accesses then at least one println wou...

C# - class field is null when accessed from a worker thread but not main thread

Not sure what I'm doing wrong: class MyClass { private EventInfo eventInfo; public void OnGenerateEvent(object sender, EventArgs e) { // Called from *main* thread // Load assembly and set eventInfo here eventInfo = ....GetEvent(...); eventInfo.AddEventHandler(source, handler); //...

How to utilize my computation resources.

Hi all, I wrote a program to solve a complicated problem. This program is just a c# console application and doesn't do console.write until the computation part is finished, so output won't affect the performance. The program is like this: static void Main(string[] args) { Thread WorkerThread = new Thread(new Thread...

Not able to display the progress bar using threading concept?

I am trying to show a progress bar while my process is going on...in my application there will be a situation where I gotta read files and manipulate them(it will take some time to complete)..want to display a progress bar during this operation..the particular function I am calling is an win 32 ...so if you check my code below ...I am ab...

Java Multi threading - Avoid duplicate request processing

I have following multi threaded environment scenario - Requests are coming to a method and I want to avoid the duplicate processing of concurrent requests coming. As multiple similar requests might be waiting for being processed in blocked state. I used hashtable to keep track of processed request, but it will create memory leaks, so how...