multithreading

C# Manual Threading

Does anyone have any good resources that show creating an unlimited number of threads in C# WITHOUT using a ThreadPool? I realize one might question the architecture of a system with hundreds or thousands of threads, so let me explain the task in case the CPU/OS will make this effort moot. I have about 2500 URLs that I need to test. S...

How to do a nonblocking update to a datagridview in c#.

I understand how to use delegates to update controls on the main control thread, works like a charm. My problem here is if I'm adding a large dataset (say 2000 items) to a bound datagridview it takes 5-8 seconds for the grid to populate and during that 5-8 seconds the whole gui is locked. How can I update the datagridview such that it ...

What is the design pattern to be used to deal with multiple requests to a share resource in IIS

I have a Lucene Index on a central file system. In my IIS application, I have methods to query the index and another to update the index. To update the index, I have to lock the file until the changes are committed. My problem in implementing this is choosing the best design pattern to maintain good concurrency. Am I best off using a s...

Cocoa - Return information from NSOperation

I have an IPhone app that uses webservices to get data from a server. I'm putting each call to the webservice in a NSOperation subclass so that it can be threaded. My question is, what is the recommended way to pass back information from a completed NSOperation subclass. I'm currently sending a NSNotification at the end of my main met...

Deleting a pointer a different places results in different behaviors (crash or not)

This question is a refinement of this one, which went in a different direction than expected. In my multithreaded application, the main thread creates parameters and stores them : typedef struct { int parameter1; double parameter2; float* parameter3; } jobParams; typedef struct { int ID; void* params; } jobData; s...

Using the webView method, "loadRequest", do I need to worry about threading? (iphone sdk question)

Lets suppose I am creating an application for the iphone with a webView down at the bottom of the window (the other part of the screen has a button and the user can interact with it). I don't want the webView to stop the user from interacting with the other part of the UI when the webView loads a new url. From my limited testing throu...

VB.Net: Does Debug.Writeline stop Thread execution?

I have a vb.net application that uses threads to asynchronously process some tasks in a "Scheduled Task" (console application). We are limiting this app to run 10 threads at once, like so: (pseudo-code) - create a generic list of 10 threads - spawn off the threadproc for each one - do a thread.join statement for each thread to wait ...

WaitHandle.WaitAny and Semaphore class

Edit: I'd like to plead temporary insanity for even asking this question, but it made sense at the time (see edit 2 below). For a .NET 3.5 project, I have two types of resources (R1 and R2) that I need to check the availability of. Each resource type can have (say) 10 instances at any time. When one of either types of resources becomes...

race condition in RMI java - 2 client 1 server

hi all, i have two clients in two different processes that communicate through RMI with the server. my question is: what happends if both clients invoking the server's stub at the same time? thanks for you time, me ...

C# Anyway to detect if an object is locked.

Hi, Is their anyway to determine if a object is locked in c#. I have the unenviable position, through design where i'm reading from a queue inside a class, and I need to dump the contents into a collection in the class. But that collection is also read/write from an interface outside the class. So obviously their may be a case when the ...

Hibernating/restarting a thread

I'm looking for a way to restart a thread, either from inside that thread's context or from outside the thread, possibly from within another process. (Any of these options will work.) I am aware of the difficulty of hibernating entire processes, and I'm pretty sure that those same difficulties attend to threads. However, I'm asking anywa...

CPU consumption equivalent for harddisk scanning.

I would like my software that scans disk structure to work in background but lowing the priority for the thread that that scans disk structure doesn't work. I mean you still have the feeling of the computer hard working and even freezing even if your program consumes only 1 percent of the processor time. Is it possible to implement "hard...

Using NSOperation for threading creates too many objects

I have an app that makes SOAP calls. To keep the UI from blocking, we are putting each SOAP call into a subclass of NSOperation. This works well, but we have a ton of different types of SOAP calls. So if we use 3 WSDLs each with 10 Ports or Operations, then we 30 different calls in SOAP and if we put each of those in a thread using NS...

Difference between javacore,thread dump and heap dump in Websphere

Can someone tell me the exact difference between javacore,thread dump and heap dump.Under which situation each of these are used?? ...

Clustering using Threads in Java

I have a job that takes too long time in Java. So I want to divide this job into threads and run them. After the threads finishes their jobs, returns to my service and Service give them new jobs. ThreadGroup is suitable for this or any other recommendation? ...

Threads in C, C++, C++0x, pthread and boost

A question about threads in C/C++... C++0x syntax #include <thread> void dummy() {} int main(int, char*[]) { std::thread x(dummy); std::thread y(dummy); ... return 0; } How many threads are there? Two (x and y) or three (x, y and main)? Can I call this_thread::yield() in main? And what do I get from calling this_thread:...

How to retrieve an object instance related to a Thread in C++?

Hello, In java I have the following generated code: public class B { public void exec(){ X x = (X) Thread.currentThread(); System.out.println(x.value); } } public class X extends Thread{ public int value; public X(int x){ value = x; } public void run(){ B b = new B(); b.exec(); } ...

Python: Why are some of Queue.queue's method "unreliable"?

In the queue class from the Queue module, there are a few methods, namely, qsize, empty and full, whose documentation claims they are "not reliable". What exactly is not reliable about them? I did notice that on the Python docs site, the following is said about qsize: Note, qsize() > 0 doesn’t guarantee that a subsequent get() wi...

Java Queue implementations, which one ?

From javadoc: A ConcurrentLinkedQueue is an appropriate choice when many threads will share access to a common collection. This queue does not permit null elements. ArrayBlockingQueue is a classic "bounded buffer", in which a fixed-sized array holds elements inserted by producers and extracted by consumers. This class supports an optio...

C# locking and general threading design question

I have a threaded console application that is working fine, but it's architecture needs to be improved, and I'd like some feedback. Currently, the program loads up a list of data, and segments that data into partitions (one chunk for each thread). The program then initializes a new thread using the ThreadPool, and passes it ONE segment...